@bash-app/bash-common 30.219.0 → 30.221.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/dist/definitions.d.ts +9 -3
- package/dist/definitions.d.ts.map +1 -1
- package/dist/definitions.js +19 -1
- package/dist/definitions.js.map +1 -1
- package/dist/extendedSchemas.d.ts +161 -1
- package/dist/extendedSchemas.d.ts.map +1 -1
- package/dist/extendedSchemas.js +20 -0
- package/dist/extendedSchemas.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/membershipDefinitions.d.ts +4 -2
- package/dist/membershipDefinitions.d.ts.map +1 -1
- package/dist/membershipDefinitions.js +9 -2
- package/dist/membershipDefinitions.js.map +1 -1
- package/dist/partnerStoreTypes.d.ts +37 -0
- package/dist/partnerStoreTypes.d.ts.map +1 -0
- package/dist/partnerStoreTypes.js +2 -0
- package/dist/partnerStoreTypes.js.map +1 -0
- package/dist/utils/__tests__/paymentUtils.test.js +179 -1
- package/dist/utils/__tests__/paymentUtils.test.js.map +1 -1
- package/dist/utils/__tests__/urlUtils.externalLink.test.d.ts +2 -0
- package/dist/utils/__tests__/urlUtils.externalLink.test.d.ts.map +1 -0
- package/dist/utils/__tests__/urlUtils.externalLink.test.js +29 -0
- package/dist/utils/__tests__/urlUtils.externalLink.test.js.map +1 -0
- package/dist/utils/paymentUtils.d.ts +66 -1
- package/dist/utils/paymentUtils.d.ts.map +1 -1
- package/dist/utils/paymentUtils.js +104 -3
- package/dist/utils/paymentUtils.js.map +1 -1
- package/dist/utils/urlUtils.d.ts +11 -0
- package/dist/utils/urlUtils.d.ts.map +1 -1
- package/dist/utils/urlUtils.js +40 -0
- package/dist/utils/urlUtils.js.map +1 -1
- package/package.json +2 -2
- package/prisma/schema.prisma +213 -2
- package/src/definitions.ts +29 -2
- package/src/extendedSchemas.ts +42 -0
- package/src/index.ts +6 -0
- package/src/membershipDefinitions.ts +10 -2
- package/src/partnerStoreTypes.ts +36 -0
- package/src/utils/__tests__/paymentUtils.test.ts +239 -0
- package/src/utils/__tests__/urlUtils.externalLink.test.ts +36 -0
- package/src/utils/paymentUtils.ts +156 -1
- package/src/utils/urlUtils.ts +45 -0
package/prisma/schema.prisma
CHANGED
|
@@ -492,6 +492,7 @@ model Promoter {
|
|
|
492
492
|
createdAt DateTime @default(now())
|
|
493
493
|
updatedAt DateTime @updatedAt
|
|
494
494
|
userId String? // null until invited promoter signs up (do not use host id as placeholder)
|
|
495
|
+
invitedEmail String? // normalized invitee email for reconciliation when userId is null
|
|
495
496
|
promoCodes BashEventPromoCode[]
|
|
496
497
|
promoterUser User? @relation(fields: [userId], references: [id])
|
|
497
498
|
|
|
@@ -658,8 +659,20 @@ model BashEvent {
|
|
|
658
659
|
donationDetails String?
|
|
659
660
|
absorbDonationFees Boolean @default(false)
|
|
660
661
|
absorbTicketFees Boolean @default(false)
|
|
661
|
-
|
|
662
|
+
/// When true, attendees may request a refund from the app/email (host approves in Tickets → Refunds). When false, self-serve refund CTAs are hidden.
|
|
663
|
+
allowAttendeeRefundRequests Boolean @default(true)
|
|
664
|
+
// GuestPays / Split: Stripe processing + Bash platform fee presentation (see platformFeeEnabled).
|
|
662
665
|
feeHandling String @default("HostAbsorbs") // "GuestPays" | "HostAbsorbs" | "Split"
|
|
666
|
+
/// When true, Bash charges platformFeeRate on ticket gross (e.g. 3%) in addition to Stripe processing pass-through.
|
|
667
|
+
platformFeeEnabled Boolean @default(false)
|
|
668
|
+
/// Bash platform take rate on ticket gross (e.g. 0.03 = 3%). Ignored when platformFeeEnabled is false.
|
|
669
|
+
platformFeeRate Float @default(0.03)
|
|
670
|
+
/// Optional: attendees can tag which act they came to see; drives attribution reports and future payouts.
|
|
671
|
+
artistAttributionEnabled Boolean @default(false)
|
|
672
|
+
/// "percentage" | "flat" — how artistPayoutRate is interpreted for suggested splits (display/export).
|
|
673
|
+
artistPayoutMode String?
|
|
674
|
+
/// Percentage of door (0–100) or flat cents per ticket depending on artistPayoutMode.
|
|
675
|
+
artistPayoutRate Float?
|
|
663
676
|
topPromoterPrize String? // Optional prize label: "Free table for your crew"
|
|
664
677
|
promoterLeaderboardIsPublic Boolean @default(false) // Host opts in to public leaderboard
|
|
665
678
|
showAttendees Boolean @default(true)
|
|
@@ -754,6 +767,7 @@ model BashEvent {
|
|
|
754
767
|
sponsorBookingRequests SponsorBookingRequest[] @relation("SponsorBookingEvent")
|
|
755
768
|
sponsorships SponsoredEvent[]
|
|
756
769
|
tickets Ticket[]
|
|
770
|
+
ticketGiftGrants TicketGiftGrant[]
|
|
757
771
|
ticketTiers TicketTier[]
|
|
758
772
|
favoritedBy UserFavorite[]
|
|
759
773
|
userPromoCodeRedemption UserPromoCodeRedemption[]
|
|
@@ -815,12 +829,59 @@ model BashEvent {
|
|
|
815
829
|
eventGroups EventGroup[]
|
|
816
830
|
groupUnlockOffers GroupUnlockOffer[]
|
|
817
831
|
|
|
832
|
+
bashEventArtists BashEventArtist[]
|
|
833
|
+
|
|
818
834
|
@@index([templateId])
|
|
819
835
|
@@index([parentEventId])
|
|
820
836
|
@@index([organizationId])
|
|
821
837
|
@@index([eventSeriesId])
|
|
822
838
|
}
|
|
823
839
|
|
|
840
|
+
/// Lineup / attribution roster for an event (optional act list for checkout tagging).
|
|
841
|
+
model BashEventArtist {
|
|
842
|
+
id String @id @default(cuid())
|
|
843
|
+
bashEventId String
|
|
844
|
+
bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
|
|
845
|
+
name String
|
|
846
|
+
serviceId String?
|
|
847
|
+
service Service? @relation(fields: [serviceId], references: [id], onDelete: SetNull)
|
|
848
|
+
sortOrder Int @default(0)
|
|
849
|
+
createdAt DateTime @default(now())
|
|
850
|
+
|
|
851
|
+
tickets Ticket[]
|
|
852
|
+
|
|
853
|
+
@@index([bashEventId])
|
|
854
|
+
@@index([serviceId])
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
enum BashCreativeStatus {
|
|
858
|
+
Pending
|
|
859
|
+
InReview
|
|
860
|
+
Editing
|
|
861
|
+
RevisionRequested
|
|
862
|
+
Delivered
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
/// Service provider promo video waitlist (Bash Creative).
|
|
866
|
+
model BashCreativeSubmission {
|
|
867
|
+
id String @id @default(cuid())
|
|
868
|
+
serviceId String
|
|
869
|
+
service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
|
|
870
|
+
submittedById String?
|
|
871
|
+
submittedBy User? @relation(fields: [submittedById], references: [id], onDelete: SetNull)
|
|
872
|
+
status BashCreativeStatus @default(Pending)
|
|
873
|
+
scriptNotes String? @db.Text
|
|
874
|
+
footageUrl String?
|
|
875
|
+
deliverableUrl String?
|
|
876
|
+
requestedAt DateTime @default(now())
|
|
877
|
+
deliveredAt DateTime?
|
|
878
|
+
updatedAt DateTime @updatedAt
|
|
879
|
+
|
|
880
|
+
@@index([serviceId])
|
|
881
|
+
@@index([status])
|
|
882
|
+
@@index([submittedById])
|
|
883
|
+
}
|
|
884
|
+
|
|
824
885
|
enum SuggestionType {
|
|
825
886
|
Included
|
|
826
887
|
Allowed
|
|
@@ -1295,7 +1356,44 @@ model TicketTier {
|
|
|
1295
1356
|
// Checkout timer: host-configurable per-tier timeout (minutes). null = no timer.
|
|
1296
1357
|
checkoutTimeoutMinutes Int?
|
|
1297
1358
|
|
|
1359
|
+
/// When true, BashPass subscribers may redeem this tier (subject to caps).
|
|
1360
|
+
bashPassEligible Boolean @default(false)
|
|
1361
|
+
/// Max BashPass redemptions for this tier (null = unlimited within tier capacity).
|
|
1362
|
+
bashPassMaxRedemptions Int?
|
|
1363
|
+
|
|
1298
1364
|
@@unique([bashEventId, title])
|
|
1365
|
+
ticketGiftGrants TicketGiftGrant[]
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
enum TicketGiftGrantStatus {
|
|
1369
|
+
Active
|
|
1370
|
+
Revoked
|
|
1371
|
+
Exhausted
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
/// Host-initiated comp block: N tickets allocated to one person to distribute.
|
|
1375
|
+
model TicketGiftGrant {
|
|
1376
|
+
id String @id @default(cuid())
|
|
1377
|
+
bashEventId String
|
|
1378
|
+
bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
|
|
1379
|
+
ticketTierId String
|
|
1380
|
+
ticketTier TicketTier @relation(fields: [ticketTierId], references: [id], onDelete: Restrict)
|
|
1381
|
+
grantedByUserId String
|
|
1382
|
+
grantedBy User @relation("GiftGrantsIssued", fields: [grantedByUserId], references: [id], onDelete: Cascade)
|
|
1383
|
+
grantedToUserId String
|
|
1384
|
+
grantedTo User @relation("GiftGrantsReceived", fields: [grantedToUserId], references: [id], onDelete: Cascade)
|
|
1385
|
+
quantity Int
|
|
1386
|
+
/// 0 = grantee may not re-gift; 1 = one level of re-gifting; null = unlimited
|
|
1387
|
+
maxGiftHops Int? @default(1)
|
|
1388
|
+
status TicketGiftGrantStatus @default(Active)
|
|
1389
|
+
note String?
|
|
1390
|
+
expiresAt DateTime?
|
|
1391
|
+
createdAt DateTime @default(now())
|
|
1392
|
+
tickets Ticket[]
|
|
1393
|
+
|
|
1394
|
+
@@index([bashEventId])
|
|
1395
|
+
@@index([grantedToUserId])
|
|
1396
|
+
@@index([grantedByUserId])
|
|
1299
1397
|
}
|
|
1300
1398
|
|
|
1301
1399
|
model Ticket {
|
|
@@ -1336,16 +1434,24 @@ model Ticket {
|
|
|
1336
1434
|
qrToken String?
|
|
1337
1435
|
|
|
1338
1436
|
// BashPoints Purchase Tracking
|
|
1339
|
-
purchaseType String? // "USD", "BashPoints", "Free", "Comp"
|
|
1437
|
+
purchaseType String? // "USD", "BashPoints", "Free", "Comp", "BashPass"
|
|
1340
1438
|
pointsPaid Int? // BashPoints amount paid (if purchaseType="BashPoints")
|
|
1341
1439
|
stripePurchaseId String? // Stripe payment ID (if purchaseType="USD")
|
|
1342
1440
|
|
|
1441
|
+
/// When set, this ticket was created from a host `TicketGiftGrant` (comp block for distribution).
|
|
1442
|
+
giftGrantId String?
|
|
1443
|
+
giftGrant TicketGiftGrant? @relation(fields: [giftGrantId], references: [id], onDelete: SetNull)
|
|
1444
|
+
/// 0 = held by original grantee; +1 per accepted gift transfer hop.
|
|
1445
|
+
giftHop Int @default(0)
|
|
1446
|
+
|
|
1343
1447
|
// Marketing attribution (from landing URL → sessionStorage → Stripe metadata → ticket row)
|
|
1344
1448
|
utmSource String?
|
|
1345
1449
|
utmMedium String?
|
|
1346
1450
|
utmCampaign String?
|
|
1347
1451
|
|
|
1348
1452
|
bashEvent BashEvent @relation(fields: [bashEventId], references: [id])
|
|
1453
|
+
attributedArtistId String?
|
|
1454
|
+
attributedArtist BashEventArtist? @relation(fields: [attributedArtistId], references: [id], onDelete: SetNull)
|
|
1349
1455
|
checkout Checkout? @relation(fields: [checkoutId], references: [id])
|
|
1350
1456
|
forUser User? @relation("TicketsISent", fields: [forUserId], references: [id])
|
|
1351
1457
|
invitation Invitation? @relation("TicketsForInvitation", fields: [invitationId], references: [id])
|
|
@@ -1360,6 +1466,8 @@ model Ticket {
|
|
|
1360
1466
|
|
|
1361
1467
|
@@index([bashEventId])
|
|
1362
1468
|
@@index([waitlistUserId])
|
|
1469
|
+
@@index([attributedArtistId])
|
|
1470
|
+
@@index([giftGrantId])
|
|
1363
1471
|
}
|
|
1364
1472
|
|
|
1365
1473
|
model TicketTransfer {
|
|
@@ -1851,6 +1959,13 @@ model User {
|
|
|
1851
1959
|
membershipLastBilledAt DateTime?
|
|
1852
1960
|
membershipFeaturedEventsUsed Int @default(0)
|
|
1853
1961
|
membershipStripeSubscriptionId String? @unique
|
|
1962
|
+
/// Optional consumer BashPass subscription (waives guest platform fee on tickets; monthly BashPoints).
|
|
1963
|
+
bashPassStripeSubscriptionId String? @unique
|
|
1964
|
+
bashPassCurrentPeriodEnd DateTime?
|
|
1965
|
+
/// Stripe price tier for standalone BashPass; effective tier may also come from membership bundle.
|
|
1966
|
+
bashPassTier BashPassTier?
|
|
1967
|
+
bashPassEventsUsedThisMonth Int @default(0)
|
|
1968
|
+
bashPassMonthlyCapResetAt DateTime?
|
|
1854
1969
|
isVerified Boolean @default(false)
|
|
1855
1970
|
verificationMethod String?
|
|
1856
1971
|
verifiedAt DateTime?
|
|
@@ -1981,11 +2096,14 @@ model User {
|
|
|
1981
2096
|
ticketsISent Ticket[] @relation("TicketsISent")
|
|
1982
2097
|
ticketsIOwn Ticket[] @relation("TicketsIOwn")
|
|
1983
2098
|
bashEventDonations BashEventDonation[]
|
|
2099
|
+
bashCreativeSubmissions BashCreativeSubmission[]
|
|
1984
2100
|
ticketsOnWaitlist Ticket[] @relation("TicketsOnWaitlist")
|
|
1985
2101
|
transfersFrom TicketTransfer[] @relation("TransfersFrom")
|
|
1986
2102
|
transfersTo TicketTransfer[] @relation("TransfersTo")
|
|
1987
2103
|
ticketTransferInvitesFrom TicketTransferInvite[] @relation("TicketTransferInviteFrom")
|
|
1988
2104
|
ticketTransferInvitesToUser TicketTransferInvite[] @relation("TicketTransferInviteToUser")
|
|
2105
|
+
giftGrantsIssued TicketGiftGrant[] @relation("GiftGrantsIssued")
|
|
2106
|
+
giftGrantsReceived TicketGiftGrant[] @relation("GiftGrantsReceived")
|
|
1989
2107
|
unblocksReceived UnblockedUserHistory[] @relation("UserUnblocksReceived")
|
|
1990
2108
|
unblocksCreated UnblockedUserHistory[] @relation("UserUnblocksMade")
|
|
1991
2109
|
suspendedBy User? @relation("SuspendedUsers", fields: [suspendedById], references: [id])
|
|
@@ -2159,6 +2277,10 @@ model UserPreferences {
|
|
|
2159
2277
|
bashFeedDefaultTab String @default("all") // "all", "upcoming", "live", "past", "saved", "my-posts"
|
|
2160
2278
|
bashFeedDefaultSort String @default("chronological") // "for_you", "chronological", "trending", etc.
|
|
2161
2279
|
bashFeedFilters Json? // Saved filter preferences as JSON
|
|
2280
|
+
/// Services discovery: keyed by service type tab, e.g. { "Entertainment": { ... } }
|
|
2281
|
+
serviceFilterSettings Json?
|
|
2282
|
+
/// Venue discovery filter bar (same pattern as serviceFilterSettings)
|
|
2283
|
+
venueFilterSettings Json?
|
|
2162
2284
|
|
|
2163
2285
|
createdAt DateTime @default(now())
|
|
2164
2286
|
updatedAt DateTime @updatedAt
|
|
@@ -2167,6 +2289,8 @@ model UserPreferences {
|
|
|
2167
2289
|
allowTagging Boolean @default(true)
|
|
2168
2290
|
showActivityStatus Boolean @default(true)
|
|
2169
2291
|
hiddenBashIds String[] @default([])
|
|
2292
|
+
/// Stat card keys hidden on public profile (e.g. followersCount, servicesCount)
|
|
2293
|
+
hiddenProfileStatKeys String[] @default([])
|
|
2170
2294
|
hideActivitySection Boolean @default(false)
|
|
2171
2295
|
allowLocationSharing Boolean @default(false)
|
|
2172
2296
|
defaultLandingPage String @default("dashboard")
|
|
@@ -2350,6 +2474,16 @@ model BiometricCredential {
|
|
|
2350
2474
|
@@index([usedForVerification])
|
|
2351
2475
|
}
|
|
2352
2476
|
|
|
2477
|
+
/// Ephemeral WebAuthn authentication challenges (server-issued; consumed after verify)
|
|
2478
|
+
model WebAuthnChallenge {
|
|
2479
|
+
id String @id @default(cuid())
|
|
2480
|
+
challenge String @unique
|
|
2481
|
+
expiresAt DateTime
|
|
2482
|
+
createdAt DateTime @default(now())
|
|
2483
|
+
|
|
2484
|
+
@@index([expiresAt])
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2353
2487
|
model Contact {
|
|
2354
2488
|
id String @id @default(cuid())
|
|
2355
2489
|
contactOwnerId String
|
|
@@ -2534,11 +2668,16 @@ model Service {
|
|
|
2534
2668
|
serviceListingStripeSubscriptionId String?
|
|
2535
2669
|
acceptsBashPoints Boolean @default(true) // NEW: Allow BashPoints payments
|
|
2536
2670
|
isVerified Boolean @default(false) // Service owner verified
|
|
2671
|
+
/// Paid discovery: featured placement on Services discovery (admin or tier).
|
|
2672
|
+
isFeaturedService Boolean @default(false)
|
|
2673
|
+
featuredServiceUntil DateTime?
|
|
2537
2674
|
isLicensed Boolean @default(false) // Has required licenses
|
|
2538
2675
|
verifiedAt DateTime? // When verification was approved
|
|
2539
2676
|
licenseNumber String? // License/registration number
|
|
2540
2677
|
certifications String[] @default([]) // Array of certification names
|
|
2541
2678
|
bashFeedPosts BashFeedPost[]
|
|
2679
|
+
bashEventArtists BashEventArtist[]
|
|
2680
|
+
bashCreativeSubmissions BashCreativeSubmission[]
|
|
2542
2681
|
associatedServicesReferencingMe AssociatedService[]
|
|
2543
2682
|
exhibitorBookingRequests ExhibitorBookingRequest[] @relation("ExhibitorBookingService")
|
|
2544
2683
|
notification Notification[]
|
|
@@ -3505,6 +3644,8 @@ model ServiceBookingDay {
|
|
|
3505
3644
|
serviceBookingRequestId String?
|
|
3506
3645
|
startDate DateTime
|
|
3507
3646
|
endDate DateTime
|
|
3647
|
+
/// Optional arrival/setup time label (e.g. "5:00 PM" or "2 hours before event"); used in reminder emails
|
|
3648
|
+
setupTime String?
|
|
3508
3649
|
subtotalBeforeTaxesCents Int @default(0)
|
|
3509
3650
|
totalBeforeTaxesCents Int
|
|
3510
3651
|
addOns ServiceBookingAddOn[]
|
|
@@ -6106,6 +6247,12 @@ enum CommentStatus {
|
|
|
6106
6247
|
Trash
|
|
6107
6248
|
}
|
|
6108
6249
|
|
|
6250
|
+
enum BashPassTier {
|
|
6251
|
+
LITE
|
|
6252
|
+
STANDARD
|
|
6253
|
+
UNLIMITED
|
|
6254
|
+
}
|
|
6255
|
+
|
|
6109
6256
|
enum MembershipTier {
|
|
6110
6257
|
Basic
|
|
6111
6258
|
Premium
|
|
@@ -7512,3 +7659,67 @@ model GroupUnlock {
|
|
|
7512
7659
|
@@unique([offerId, groupId])
|
|
7513
7660
|
@@index([groupId])
|
|
7514
7661
|
}
|
|
7662
|
+
|
|
7663
|
+
// ─── BashStore + Partner Ads ────────────────────────────────────────────────
|
|
7664
|
+
|
|
7665
|
+
enum PartnerTier {
|
|
7666
|
+
Affiliate
|
|
7667
|
+
Standard
|
|
7668
|
+
Featured
|
|
7669
|
+
}
|
|
7670
|
+
|
|
7671
|
+
model PartnerBrand {
|
|
7672
|
+
id String @id @default(cuid())
|
|
7673
|
+
name String
|
|
7674
|
+
logoUrl String?
|
|
7675
|
+
websiteUrl String?
|
|
7676
|
+
description String? @db.Text
|
|
7677
|
+
tier PartnerTier @default(Standard)
|
|
7678
|
+
isActive Boolean @default(true)
|
|
7679
|
+
affiliateBaseUrl String?
|
|
7680
|
+
listingFeeMonthly Int? // cents; null = affiliate-only
|
|
7681
|
+
createdAt DateTime @default(now())
|
|
7682
|
+
products PartnerProduct[]
|
|
7683
|
+
adSlots PartnerAdSlot[]
|
|
7684
|
+
|
|
7685
|
+
@@index([isActive, tier])
|
|
7686
|
+
}
|
|
7687
|
+
|
|
7688
|
+
model PartnerProduct {
|
|
7689
|
+
id String @id @default(cuid())
|
|
7690
|
+
brandId String
|
|
7691
|
+
brand PartnerBrand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
7692
|
+
name String
|
|
7693
|
+
description String? @db.Text
|
|
7694
|
+
imageUrl String?
|
|
7695
|
+
priceSummary String?
|
|
7696
|
+
affiliateUrl String
|
|
7697
|
+
categories String[]
|
|
7698
|
+
isActive Boolean @default(true)
|
|
7699
|
+
sortOrder Int @default(0)
|
|
7700
|
+
impressions Int @default(0)
|
|
7701
|
+
clicks Int @default(0)
|
|
7702
|
+
createdAt DateTime @default(now())
|
|
7703
|
+
adSlots PartnerAdSlot[]
|
|
7704
|
+
|
|
7705
|
+
@@index([brandId, isActive])
|
|
7706
|
+
}
|
|
7707
|
+
|
|
7708
|
+
model PartnerAdSlot {
|
|
7709
|
+
id String @id @default(cuid())
|
|
7710
|
+
brandId String
|
|
7711
|
+
productId String?
|
|
7712
|
+
wizardStep String? // e.g. "what_included", "how_services_dj"
|
|
7713
|
+
triggerTags String[]
|
|
7714
|
+
impressions Int @default(0)
|
|
7715
|
+
clicks Int @default(0)
|
|
7716
|
+
isActive Boolean @default(true)
|
|
7717
|
+
startsAt DateTime?
|
|
7718
|
+
endsAt DateTime?
|
|
7719
|
+
createdAt DateTime @default(now())
|
|
7720
|
+
brand PartnerBrand @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
|
7721
|
+
product PartnerProduct? @relation(fields: [productId], references: [id], onDelete: SetNull)
|
|
7722
|
+
|
|
7723
|
+
@@index([isActive, wizardStep])
|
|
7724
|
+
@@index([brandId])
|
|
7725
|
+
}
|
package/src/definitions.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BashEventType,
|
|
3
|
+
BashPassTier,
|
|
3
4
|
BracketType,
|
|
4
5
|
CompetitionType,
|
|
5
6
|
Contact,
|
|
@@ -15,7 +16,12 @@ import {
|
|
|
15
16
|
YearsOfExperience,
|
|
16
17
|
} from "@prisma/client";
|
|
17
18
|
import type { BashEventDressTags, BashEventVibeTags } from "@prisma/client";
|
|
18
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
CheckoutExt,
|
|
21
|
+
PublicUser,
|
|
22
|
+
ServiceBookingExt,
|
|
23
|
+
type UserExt,
|
|
24
|
+
} from "./extendedSchemas.js";
|
|
19
25
|
import { LuxonDateRange } from "./utils/luxonUtils.js";
|
|
20
26
|
import { ApiServiceCantBookReason } from "./utils/service/apiServiceBookingApiUtils.js";
|
|
21
27
|
import { ServiceAttendeeOption } from "./utils/service/attendeeOptionUtils.js";
|
|
@@ -40,6 +46,27 @@ export const STRIPE_API_TIMEOUT_MS = 15000 as const; // 15 seconds for API calls
|
|
|
40
46
|
*/
|
|
41
47
|
export const DEFAULT_IDEA_INTEREST_THRESHOLD = 35 as const;
|
|
42
48
|
|
|
49
|
+
/** Monthly BashPass event redemption caps by tier (`null` = unlimited). */
|
|
50
|
+
export const BASH_PASS_EVENT_CAPS: Record<BashPassTier, number | null> = {
|
|
51
|
+
[BashPassTier.LITE]: 4,
|
|
52
|
+
[BashPassTier.STANDARD]: 8,
|
|
53
|
+
[BashPassTier.UNLIMITED]: null,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** For comparing which BashPass tier is higher when user has membership bundle + standalone. */
|
|
57
|
+
export const BASH_PASS_TIER_RANK: Record<BashPassTier, number> = {
|
|
58
|
+
[BashPassTier.LITE]: 1,
|
|
59
|
+
[BashPassTier.STANDARD]: 2,
|
|
60
|
+
[BashPassTier.UNLIMITED]: 3,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** Env var names for Stripe Price IDs (read at runtime in API). */
|
|
64
|
+
export const BASH_PASS_PRICE_ENV_KEYS: Record<BashPassTier, string> = {
|
|
65
|
+
[BashPassTier.LITE]: "STRIPE_BASH_PASS_LITE_PRICE_ID",
|
|
66
|
+
[BashPassTier.STANDARD]: "STRIPE_BASH_PASS_STANDARD_PRICE_ID",
|
|
67
|
+
[BashPassTier.UNLIMITED]: "STRIPE_BASH_PASS_UNLIMITED_PRICE_ID",
|
|
68
|
+
};
|
|
69
|
+
|
|
43
70
|
export const URL_PARAMS_BASH_EVENT_ID = "bashEventId" as const;
|
|
44
71
|
export const URL_PARAMS_BASH_EVENT_TITLE = "bashEventTitle" as const;
|
|
45
72
|
export const URL_PARAMS_BASH_EVENT_DESC = "bashEventDesc" as const;
|
|
@@ -318,7 +345,7 @@ export type DateTimeArgType = Date | string | undefined | null;
|
|
|
318
345
|
export type RequiredStripeInfoMissingErrorDataType = {
|
|
319
346
|
[k in keyof User]?: { type: string; label: string };
|
|
320
347
|
};
|
|
321
|
-
export type ContactOrUser = Contact | PublicUser;
|
|
348
|
+
export type ContactOrUser = Contact | PublicUser | UserExt;
|
|
322
349
|
|
|
323
350
|
export type ValueOf<T> = T[keyof T];
|
|
324
351
|
|
package/src/extendedSchemas.ts
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
AmountOfGuests,
|
|
3
3
|
AssociatedBash,
|
|
4
4
|
AssociatedService,
|
|
5
|
+
BashAvailability,
|
|
5
6
|
BashComment,
|
|
6
7
|
BashEvent,
|
|
7
8
|
BashEventSuggestion,
|
|
@@ -189,6 +190,12 @@ export const PRIVATE_USER_ACCOUNT_TO_SELECT = {
|
|
|
189
190
|
zipCode: true,
|
|
190
191
|
country: true,
|
|
191
192
|
phone: true,
|
|
193
|
+
membershipExpiresAt: true,
|
|
194
|
+
bashPassStripeSubscriptionId: true,
|
|
195
|
+
bashPassCurrentPeriodEnd: true,
|
|
196
|
+
bashPassTier: true,
|
|
197
|
+
bashPassEventsUsedThisMonth: true,
|
|
198
|
+
bashPassMonthlyCapResetAt: true,
|
|
192
199
|
userSubscription: {
|
|
193
200
|
select: PRIVATE_USER_SUBSCRIPTION_DATA_TO_SELECT,
|
|
194
201
|
},
|
|
@@ -791,6 +798,13 @@ export const SERVICE_BOOKING_PUBLIC_DATA_TO_INCLUDE = {
|
|
|
791
798
|
},
|
|
792
799
|
} satisfies Prisma.ServiceBookingInclude;
|
|
793
800
|
|
|
801
|
+
/** Minimal service shape returned by profile booking list APIs (`serviceName` is the DB column). */
|
|
802
|
+
export type BookingServiceRef = {
|
|
803
|
+
id: string;
|
|
804
|
+
serviceName: string;
|
|
805
|
+
serviceType: string;
|
|
806
|
+
};
|
|
807
|
+
|
|
794
808
|
export const SERVICE_BOOKING_PRIVATE_DATA_TO_INCLUDE = {
|
|
795
809
|
...SERVICE_BOOKING_PUBLIC_DATA_TO_INCLUDE,
|
|
796
810
|
checkout: {
|
|
@@ -1149,6 +1163,25 @@ export interface TicketTierExt extends TicketTier {
|
|
|
1149
1163
|
promoCodes: BashEventPromoCode[];
|
|
1150
1164
|
}
|
|
1151
1165
|
|
|
1166
|
+
/** Host / API include for `TicketGiftGrant` lists and create responses. */
|
|
1167
|
+
export const TICKET_GIFT_GRANT_DATA_TO_INCLUDE = {
|
|
1168
|
+
ticketTier: { select: { id: true, title: true, bashEventId: true } },
|
|
1169
|
+
grantedBy: { select: FRONT_END_USER_DATA_TO_SELECT },
|
|
1170
|
+
grantedTo: { select: FRONT_END_USER_DATA_TO_SELECT },
|
|
1171
|
+
tickets: {
|
|
1172
|
+
select: {
|
|
1173
|
+
id: true,
|
|
1174
|
+
status: true,
|
|
1175
|
+
giftHop: true,
|
|
1176
|
+
ownerId: true,
|
|
1177
|
+
},
|
|
1178
|
+
},
|
|
1179
|
+
} satisfies Prisma.TicketGiftGrantInclude;
|
|
1180
|
+
|
|
1181
|
+
export type TicketGiftGrantExt = Prisma.TicketGiftGrantGetPayload<{
|
|
1182
|
+
include: typeof TICKET_GIFT_GRANT_DATA_TO_INCLUDE;
|
|
1183
|
+
}>;
|
|
1184
|
+
|
|
1152
1185
|
export interface TicketExt extends Ticket {
|
|
1153
1186
|
owner: PublicUser;
|
|
1154
1187
|
forUser: PublicUser;
|
|
@@ -1189,6 +1222,15 @@ export interface UserExt extends User {
|
|
|
1189
1222
|
stats?: UserStats | null;
|
|
1190
1223
|
demerits?: Demerit[] | null;
|
|
1191
1224
|
|
|
1225
|
+
/**
|
|
1226
|
+
* Computed by public user API when `showBirthdayOnProfile` is true (not a DB column).
|
|
1227
|
+
* Example: "April 3".
|
|
1228
|
+
*/
|
|
1229
|
+
birthdayDisplay?: string;
|
|
1230
|
+
|
|
1231
|
+
/** Included when the user query selects the `UserAvailability` relation (not on default Prisma `User`). */
|
|
1232
|
+
bashAvailability?: BashAvailability | null;
|
|
1233
|
+
|
|
1192
1234
|
// Do not include in fetch as there could be thousands of these
|
|
1193
1235
|
userSubscription?: UserSubscriptionExt | null;
|
|
1194
1236
|
associatedBashes?: AssociatedBash[] | null;
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./utmAttribution.js";
|
|
|
4
4
|
export * from "./venueLoyaltyRedemption.js";
|
|
5
5
|
export * from "./stripeListingSubscriptionMessages.js";
|
|
6
6
|
export * from "./extendedSchemas.js";
|
|
7
|
+
export * from "./partnerStoreTypes.js";
|
|
7
8
|
export * from "./bashFeedTypes.js";
|
|
8
9
|
export * from "./membershipDefinitions.js";
|
|
9
10
|
|
|
@@ -26,6 +27,7 @@ export {
|
|
|
26
27
|
BalloonsFormat,
|
|
27
28
|
BartenderFormat,
|
|
28
29
|
BashAssociationType,
|
|
30
|
+
BashPassTier,
|
|
29
31
|
BashAvailabilityWindow,
|
|
30
32
|
BashEventDressTags,
|
|
31
33
|
BashEventSource,
|
|
@@ -133,6 +135,7 @@ export {
|
|
|
133
135
|
PrivateChefFormat,
|
|
134
136
|
PrizePaymentMethod,
|
|
135
137
|
PrizePaymentStatus,
|
|
138
|
+
PartnerTier,
|
|
136
139
|
PrizeType,
|
|
137
140
|
ProjectorSetupFormat,
|
|
138
141
|
PromoterFormat,
|
|
@@ -224,6 +227,9 @@ export type {
|
|
|
224
227
|
Link,
|
|
225
228
|
Media,
|
|
226
229
|
Organization,
|
|
230
|
+
PartnerAdSlot,
|
|
231
|
+
PartnerBrand,
|
|
232
|
+
PartnerProduct,
|
|
227
233
|
Recurrence,
|
|
228
234
|
Service,
|
|
229
235
|
ServiceAddon,
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
// Membership tier definitions and constants shared between frontend and backend
|
|
2
|
-
import { MembershipTier, ReferralTier, CreditTransactionType } from '@prisma/client';
|
|
2
|
+
import { BashPassTier, MembershipTier, ReferralTier, CreditTransactionType } from '@prisma/client';
|
|
3
3
|
|
|
4
|
-
export { MembershipTier, ReferralTier, CreditTransactionType };
|
|
4
|
+
export { BashPassTier, MembershipTier, ReferralTier, CreditTransactionType };
|
|
5
|
+
|
|
6
|
+
/** BashPass tier included with paid membership (standalone Stripe BashPass can stack; higher tier wins). */
|
|
7
|
+
export const MEMBERSHIP_BASH_PASS_TIER: Partial<Record<MembershipTier, BashPassTier>> = {
|
|
8
|
+
[MembershipTier.Premium]: BashPassTier.LITE,
|
|
9
|
+
[MembershipTier.Pro]: BashPassTier.STANDARD,
|
|
10
|
+
[MembershipTier.Elite]: BashPassTier.UNLIMITED,
|
|
11
|
+
[MembershipTier.Legend]: BashPassTier.UNLIMITED,
|
|
12
|
+
};
|
|
5
13
|
|
|
6
14
|
export type MembershipBillingInterval = 'Monthly' | 'Yearly';
|
|
7
15
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { PartnerTier } from "@prisma/client";
|
|
2
|
+
|
|
3
|
+
/** Product row returned by BashStore / wizard suggestion APIs (no internal counters). */
|
|
4
|
+
export type PartnerProductPublic = {
|
|
5
|
+
id: string;
|
|
6
|
+
brandId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string | null;
|
|
9
|
+
imageUrl: string | null;
|
|
10
|
+
priceSummary: string | null;
|
|
11
|
+
affiliateUrl: string;
|
|
12
|
+
categories: string[];
|
|
13
|
+
sortOrder: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type PartnerBrandSummary = {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
logoUrl: string | null;
|
|
20
|
+
websiteUrl: string | null;
|
|
21
|
+
description: string | null;
|
|
22
|
+
tier: PartnerTier;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** GET /api/partner/store */
|
|
26
|
+
export type PartnerStoreResponse = {
|
|
27
|
+
featured: (PartnerBrandSummary & { products: PartnerProductPublic[] }) | null;
|
|
28
|
+
brands: (PartnerBrandSummary & { products: PartnerProductPublic[] })[];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** GET /api/partner/suggestions — at most one suggestion */
|
|
32
|
+
export type PartnerSuggestionResponse = {
|
|
33
|
+
slotId: string;
|
|
34
|
+
product: PartnerProductPublic;
|
|
35
|
+
brand: PartnerBrandSummary;
|
|
36
|
+
};
|