@bash-app/bash-common 30.155.0 → 30.158.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 +19 -8
- package/dist/definitions.d.ts.map +1 -1
- package/dist/definitions.js +2 -20
- package/dist/definitions.js.map +1 -1
- package/dist/extendedSchemas.d.ts +2 -2
- package/dist/extendedSchemas.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/membershipDefinitions.d.ts +7 -12
- package/dist/membershipDefinitions.d.ts.map +1 -1
- package/dist/membershipDefinitions.js.map +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/luxonUtils.d.ts.map +1 -1
- package/dist/utils/luxonUtils.js +1 -73
- package/dist/utils/luxonUtils.js.map +1 -1
- package/dist/utils/service/serviceDBUtils.d.ts +2 -0
- package/dist/utils/service/serviceDBUtils.d.ts.map +1 -1
- package/dist/utils/service/serviceDBUtils.js +2 -41
- package/dist/utils/service/serviceDBUtils.js.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/add_bash_availability.sql +53 -0
- package/prisma/migrations/add_event_group_allow_auto_join.sql +17 -0
- package/prisma/migrations/add_group_member_status_not_going_maybe.sql +5 -0
- package/prisma/migrations/add_groups_and_momentum.sql +135 -0
- package/prisma/migrations/add_groups_momentum_phase0_4.sql +200 -0
- package/prisma/migrations/add_new_feature_tables.sql +140 -0
- package/prisma/migrations/add_tier_privacy_and_fee_handling.sql +29 -0
- package/prisma/schema.prisma +241 -0
- package/src/definitions.ts +25 -73
- package/src/extendedSchemas.ts +2 -2
- package/src/index.ts +0 -1
- package/src/membershipDefinitions.ts +8 -14
- package/src/utils/index.ts +0 -1
- package/src/utils/luxonUtils.ts +1 -111
- package/src/utils/service/serviceDBUtils.ts +2 -41
- package/src/utils/service/serviceRateDBUtils.ts +0 -179
package/prisma/schema.prisma
CHANGED
|
@@ -608,6 +608,9 @@ model BashEvent {
|
|
|
608
608
|
donationDetails String?
|
|
609
609
|
absorbDonationFees Boolean @default(false)
|
|
610
610
|
absorbTicketFees Boolean @default(false)
|
|
611
|
+
feeHandling String @default("GuestPays") // "GuestPays" | "HostAbsorbs" | "Split"
|
|
612
|
+
topPromoterPrize String? // Optional prize label: "Free table for your crew"
|
|
613
|
+
promoterLeaderboardIsPublic Boolean @default(false) // Host opts in to public leaderboard
|
|
611
614
|
showAttendees Boolean @default(true)
|
|
612
615
|
servicePreferences Json? // New tiered status: { "Entertainment": "need", "Sponsors": "booked_closed", ... }
|
|
613
616
|
bookedServices Json? // Booked service details: { "Entertainment": { serviceId: "...", providerId: "...", bookedAt: "..." }, ... }
|
|
@@ -716,6 +719,13 @@ model BashEvent {
|
|
|
716
719
|
// Analytics Relations
|
|
717
720
|
analyticsPredictions AnalyticsPrediction[]
|
|
718
721
|
|
|
722
|
+
// Per-event referral rewards
|
|
723
|
+
eventReferralRewards EventReferralReward[]
|
|
724
|
+
eventReferrals EventReferral[]
|
|
725
|
+
|
|
726
|
+
// User night itineraries (events in user's "My Night" plan)
|
|
727
|
+
userItineraryItems UserItineraryItem[]
|
|
728
|
+
|
|
719
729
|
// Event series (recurring template instances)
|
|
720
730
|
eventSeriesId String?
|
|
721
731
|
eventSeries EventSeries? @relation("SeriesEvents", fields: [eventSeriesId], references: [id], onDelete: SetNull)
|
|
@@ -724,6 +734,11 @@ model BashEvent {
|
|
|
724
734
|
budgets Budget[] @relation("EventBudgets")
|
|
725
735
|
rsvps EventRSVP[] @relation("EventRSVPs")
|
|
726
736
|
|
|
737
|
+
// Groups & page views (Phases 0–4)
|
|
738
|
+
pageViews BashEventPageView[]
|
|
739
|
+
eventGroups EventGroup[]
|
|
740
|
+
groupUnlockOffers GroupUnlockOffer[]
|
|
741
|
+
|
|
727
742
|
@@index([templateId])
|
|
728
743
|
@@index([parentEventId])
|
|
729
744
|
@@index([organizationId])
|
|
@@ -794,6 +809,92 @@ model IdeaConfiguration {
|
|
|
794
809
|
@@index([isActive])
|
|
795
810
|
}
|
|
796
811
|
|
|
812
|
+
// Per-event referral rewards: host defines tiers (e.g. 3 referrals = free drink)
|
|
813
|
+
model EventReferralReward {
|
|
814
|
+
id String @id @default(cuid())
|
|
815
|
+
bashEventId String
|
|
816
|
+
referralCount Int // How many referrals needed for this reward
|
|
817
|
+
rewardType String // BashPoints, FreeTicket, FreeDrink, Custom
|
|
818
|
+
rewardLabel String // e.g. "Free drink at the bar"
|
|
819
|
+
bashPointsAmount Int? // When rewardType=BashPoints
|
|
820
|
+
sortOrder Int @default(0)
|
|
821
|
+
createdAt DateTime @default(now())
|
|
822
|
+
updatedAt DateTime @updatedAt
|
|
823
|
+
|
|
824
|
+
bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
|
|
825
|
+
|
|
826
|
+
@@index([bashEventId])
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
// Tracks referrals: attendee A referred person B who bought a ticket
|
|
830
|
+
model EventReferral {
|
|
831
|
+
id String @id @default(cuid())
|
|
832
|
+
bashEventId String
|
|
833
|
+
referrerId String // Attendee who shared their link
|
|
834
|
+
referredUserId String // Person who bought via the link
|
|
835
|
+
ticketId String? @unique // Ticket purchased (optional, 1:1 with Ticket)
|
|
836
|
+
createdAt DateTime @default(now())
|
|
837
|
+
|
|
838
|
+
bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
|
|
839
|
+
referrer User @relation("EventReferralsMade", fields: [referrerId], references: [id], onDelete: Cascade)
|
|
840
|
+
referredUser User @relation("EventReferralsReceived", fields: [referredUserId], references: [id], onDelete: Cascade)
|
|
841
|
+
ticket Ticket? @relation(fields: [ticketId], references: [id], onDelete: SetNull)
|
|
842
|
+
|
|
843
|
+
@@unique([bashEventId, referrerId, referredUserId])
|
|
844
|
+
@@index([bashEventId])
|
|
845
|
+
@@index([referrerId])
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
// Curated event lists for discovery (super-user editorial tool)
|
|
849
|
+
model BashList {
|
|
850
|
+
id String @id @default(cuid())
|
|
851
|
+
title String // e.g. "Best Friday Night in Ogden"
|
|
852
|
+
slug String @unique // URL-friendly identifier
|
|
853
|
+
description String? @db.Text
|
|
854
|
+
filterConfig Json // { dateRange?, city?, state?, eventType?, maxPrice?, ... }
|
|
855
|
+
isFeatured Boolean @default(false)
|
|
856
|
+
sortOrder Int @default(0)
|
|
857
|
+
createdById String
|
|
858
|
+
createdAt DateTime @default(now())
|
|
859
|
+
updatedAt DateTime @updatedAt
|
|
860
|
+
|
|
861
|
+
createdBy User @relation(fields: [createdById], references: [id], onDelete: Cascade)
|
|
862
|
+
|
|
863
|
+
@@index([isFeatured, sortOrder])
|
|
864
|
+
@@index([slug])
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
// User's personal multi-event night plan (e.g. Dinner 6:30 → Comedy 8:00 → Dance 10:00)
|
|
868
|
+
model UserItinerary {
|
|
869
|
+
id String @id @default(cuid())
|
|
870
|
+
userId String
|
|
871
|
+
date DateTime @db.Date // The night (e.g. 2026-03-15)
|
|
872
|
+
title String? // e.g. "Friday night out"
|
|
873
|
+
createdAt DateTime @default(now())
|
|
874
|
+
updatedAt DateTime @updatedAt
|
|
875
|
+
|
|
876
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
877
|
+
items UserItineraryItem[]
|
|
878
|
+
|
|
879
|
+
@@unique([userId, date])
|
|
880
|
+
@@index([userId])
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
model UserItineraryItem {
|
|
884
|
+
id String @id @default(cuid())
|
|
885
|
+
userItineraryId String
|
|
886
|
+
bashEventId String
|
|
887
|
+
sortOrder Int @default(0)
|
|
888
|
+
notes String? @db.Text
|
|
889
|
+
createdAt DateTime @default(now())
|
|
890
|
+
|
|
891
|
+
userItinerary UserItinerary @relation(fields: [userItineraryId], references: [id], onDelete: Cascade)
|
|
892
|
+
bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
|
|
893
|
+
|
|
894
|
+
@@unique([userItineraryId, bashEventId])
|
|
895
|
+
@@index([userItineraryId])
|
|
896
|
+
}
|
|
897
|
+
|
|
797
898
|
model Coordinates {
|
|
798
899
|
id Int @id @default(autoincrement())
|
|
799
900
|
lat Float?
|
|
@@ -980,6 +1081,7 @@ model TicketTier {
|
|
|
980
1081
|
waitList User[] @relation("TicketTierToUser")
|
|
981
1082
|
specialOffers SpecialOffer[] // NEW - Special offers for this tier
|
|
982
1083
|
appliedDiscounts AppliedDiscount[] // NEW - Discounts applied to this tier
|
|
1084
|
+
groupUnlockOffers GroupUnlockOffer[] // Phase 4: Group unlock incentives
|
|
983
1085
|
|
|
984
1086
|
// BashPoints Pricing (peer-to-peer economy)
|
|
985
1087
|
pricingType PricingType @default(USD) // 'USD' or 'BASHPOINTS'
|
|
@@ -995,6 +1097,16 @@ model TicketTier {
|
|
|
995
1097
|
isWaitlistTier Boolean @default(false) // Attendees request a spot; host approves/denies
|
|
996
1098
|
waitlistCapacity Int? // Max waitlist size; null = unlimited
|
|
997
1099
|
|
|
1100
|
+
// Availability rules
|
|
1101
|
+
availabilityType String @default("Immediate") // "Immediate" | "OnDate" | "EngagedUsersOnly" | "UnlockWhenInterestReached" | "UnlockWhenTicketsSold"
|
|
1102
|
+
availableAt DateTime? // OnDate: when tier unlocks
|
|
1103
|
+
availableWhenInterestReached Int? // UnlockWhenInterestReached: min IdeaInterest count
|
|
1104
|
+
unlockWhenTicketsSold Int? // UnlockWhenTicketsSold: min tickets sold across event to unlock this tier
|
|
1105
|
+
maxTicketsPerUser Int? // Optional per-user purchase cap
|
|
1106
|
+
|
|
1107
|
+
// Privacy: "Public" | "LinkOnly" | "InviteOnly"
|
|
1108
|
+
tierPrivacy String @default("Public")
|
|
1109
|
+
|
|
998
1110
|
@@unique([bashEventId, title])
|
|
999
1111
|
}
|
|
1000
1112
|
|
|
@@ -1046,6 +1158,7 @@ model Ticket {
|
|
|
1046
1158
|
metadata TicketMetadata[]
|
|
1047
1159
|
transfers TicketTransfer[]
|
|
1048
1160
|
appliedDiscounts AppliedDiscount[] // NEW - Discounts applied to this ticket
|
|
1161
|
+
eventReferral EventReferral? // When this ticket was purchased via a referral link
|
|
1049
1162
|
|
|
1050
1163
|
@@index([bashEventId])
|
|
1051
1164
|
@@index([waitlistUserId])
|
|
@@ -1613,6 +1726,10 @@ model User {
|
|
|
1613
1726
|
bashEventPromoCodesIUsed BashEventPromoCode[] @relation("BashEventPromoCodeToUser")
|
|
1614
1727
|
ticketTiersWaitListsIveJoined TicketTier[] @relation("TicketTierToUser")
|
|
1615
1728
|
scoutReferralsMade ScoutReferral[] @relation("ScoutReferrer")
|
|
1729
|
+
eventReferralsMade EventReferral[] @relation("EventReferralsMade")
|
|
1730
|
+
eventReferralsReceived EventReferral[] @relation("EventReferralsReceived")
|
|
1731
|
+
bashListsCreated BashList[]
|
|
1732
|
+
userItineraries UserItinerary[]
|
|
1616
1733
|
aiRecommendationLogs AIRecommendationLog[]
|
|
1617
1734
|
scoutReferralsReceived ScoutReferral[] @relation("ScoutReferred")
|
|
1618
1735
|
|
|
@@ -1668,6 +1785,10 @@ model User {
|
|
|
1668
1785
|
|
|
1669
1786
|
// Availability
|
|
1670
1787
|
bashAvailability BashAvailability? @relation("UserAvailability")
|
|
1788
|
+
|
|
1789
|
+
// Groups
|
|
1790
|
+
ownedGroups EventGroup[] @relation("OwnedGroups")
|
|
1791
|
+
groupMembers GroupMember[] @relation("GroupMemberships")
|
|
1671
1792
|
}
|
|
1672
1793
|
|
|
1673
1794
|
model UserPreferences {
|
|
@@ -3613,6 +3734,17 @@ enum NotificationType {
|
|
|
3613
3734
|
WaitlistDenied // Attendee: host denied your waitlist request
|
|
3614
3735
|
WaitlistSpotAvailable // Waitlister: a refund opened a spot — claim it now
|
|
3615
3736
|
WaitlistSpotMayBeOpen // Waitlister: someone left the venue — standby at door
|
|
3737
|
+
// Group notifications
|
|
3738
|
+
GroupMemberPurchased // Owner: "Riley just bought a ticket — 2 more to go!"
|
|
3739
|
+
GroupEveryoneConfirmed // Owner: "All members want to attend. Buy tickets together?"
|
|
3740
|
+
GroupEveryonePurchased // Owner: "Your group is officially attending"
|
|
3741
|
+
GroupMemberJoined // Owner: "Alex joined your group"
|
|
3742
|
+
FriendsAttending // User: "3 of your friends are attending this bash"
|
|
3743
|
+
GroupRewardProgress // Member: "Only 2 more friends needed for your group reward"
|
|
3744
|
+
GroupUnlockOfferReceived // Member: "Special offer unlocked for your group"
|
|
3745
|
+
HostSalesAccelerating // Host: "Your event sales increased 38% today"
|
|
3746
|
+
HostTopPromoter // Host: "Top promoter: Alex (6 tickets today)"
|
|
3747
|
+
HostSalesSlowing // Host: "Sales slowed today. Try sharing your event."
|
|
3616
3748
|
}
|
|
3617
3749
|
|
|
3618
3750
|
enum NotificationPriority {
|
|
@@ -5559,6 +5691,7 @@ enum CreditSourceType {
|
|
|
5559
5691
|
FirstShareBash // First time sharing a bash event
|
|
5560
5692
|
FirstInviteToBash // First invite to someone else's bash
|
|
5561
5693
|
BirthdayReward // Annual BashPoints boost on user's birthday
|
|
5694
|
+
EventReferralReward // Per-event: attendee referred X friends, earned reward
|
|
5562
5695
|
}
|
|
5563
5696
|
|
|
5564
5697
|
enum PendingGiftStatus {
|
|
@@ -6721,3 +6854,111 @@ model BashAvailability {
|
|
|
6721
6854
|
|
|
6722
6855
|
@@index([city, window, expiresAt])
|
|
6723
6856
|
}
|
|
6857
|
+
|
|
6858
|
+
// ─── Phase 0: Momentum Dashboard ────────────────────────────────────────────
|
|
6859
|
+
|
|
6860
|
+
// Anonymous page view for conversion rate tracking. No PII stored.
|
|
6861
|
+
model BashEventPageView {
|
|
6862
|
+
id String @id @default(cuid())
|
|
6863
|
+
bashEventId String
|
|
6864
|
+
sessionHash String // hashed IP+UA for dedup
|
|
6865
|
+
viewedAt DateTime @default(now())
|
|
6866
|
+
|
|
6867
|
+
bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
|
|
6868
|
+
|
|
6869
|
+
@@index([bashEventId, viewedAt])
|
|
6870
|
+
}
|
|
6871
|
+
|
|
6872
|
+
// ─── Phase 1: Bash Groups ────────────────────────────────────────────────────
|
|
6873
|
+
|
|
6874
|
+
enum GroupVisibility {
|
|
6875
|
+
Private // Default: owner curates members
|
|
6876
|
+
OpenLink // Anyone with the group link can self-join as WantsToGo
|
|
6877
|
+
}
|
|
6878
|
+
|
|
6879
|
+
enum GroupMemberStatus {
|
|
6880
|
+
Going // Ticket purchased / attending
|
|
6881
|
+
WantsToGo // Interested, no ticket yet
|
|
6882
|
+
Maybe // Maybe attending (aligns with Invitation maybeDate)
|
|
6883
|
+
NotGoing // Not attending (aligns with Invitation rejectedDate)
|
|
6884
|
+
Invited // Invited by owner, not yet responded
|
|
6885
|
+
}
|
|
6886
|
+
|
|
6887
|
+
// A group of attendees for a specific event
|
|
6888
|
+
model EventGroup {
|
|
6889
|
+
id String @id @default(cuid())
|
|
6890
|
+
bashEventId String
|
|
6891
|
+
ownerId String
|
|
6892
|
+
name String? // e.g. "Steve's Birthday Group", "Weber State Crew"
|
|
6893
|
+
maxMembers Int? // null = unlimited
|
|
6894
|
+
visibility GroupVisibility @default(Private)
|
|
6895
|
+
allowAutoJoin Boolean @default(false) // When true, anyone can join instantly; when false, requests require approval
|
|
6896
|
+
promoterId String? // Optional: links to event promoter for display context
|
|
6897
|
+
createdAt DateTime @default(now())
|
|
6898
|
+
updatedAt DateTime @updatedAt
|
|
6899
|
+
|
|
6900
|
+
bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
|
|
6901
|
+
owner User @relation("OwnedGroups", fields: [ownerId], references: [id], onDelete: Cascade)
|
|
6902
|
+
members GroupMember[]
|
|
6903
|
+
unlocks GroupUnlock[]
|
|
6904
|
+
|
|
6905
|
+
@@unique([bashEventId, ownerId])
|
|
6906
|
+
@@index([bashEventId])
|
|
6907
|
+
@@index([ownerId])
|
|
6908
|
+
}
|
|
6909
|
+
|
|
6910
|
+
// Membership record within a group
|
|
6911
|
+
model GroupMember {
|
|
6912
|
+
id String @id @default(cuid())
|
|
6913
|
+
groupId String
|
|
6914
|
+
userId String
|
|
6915
|
+
status GroupMemberStatus @default(Invited)
|
|
6916
|
+
ticketId String? // Set when status = Going
|
|
6917
|
+
joinedAt DateTime @default(now())
|
|
6918
|
+
|
|
6919
|
+
group EventGroup @relation(fields: [groupId], references: [id], onDelete: Cascade)
|
|
6920
|
+
user User @relation("GroupMemberships", fields: [userId], references: [id], onDelete: Cascade)
|
|
6921
|
+
|
|
6922
|
+
@@unique([groupId, userId])
|
|
6923
|
+
@@index([groupId])
|
|
6924
|
+
@@index([userId])
|
|
6925
|
+
}
|
|
6926
|
+
|
|
6927
|
+
// ─── Phase 1.5: Promoter Leaderboards ───────────────────────────────────────
|
|
6928
|
+
// topPromoterPrize and promoterLeaderboardIsPublic are added to BashEvent via migration SQL.
|
|
6929
|
+
|
|
6930
|
+
// ─── Phase 4: Group Unlock Incentives ───────────────────────────────────────
|
|
6931
|
+
|
|
6932
|
+
// Host-created time-limited offer targeting a specific group
|
|
6933
|
+
model GroupUnlockOffer {
|
|
6934
|
+
id String @id @default(cuid())
|
|
6935
|
+
bashEventId String
|
|
6936
|
+
ticketTierId String? // Optional: scoped to a specific tier
|
|
6937
|
+
minGroupSize Int // Minimum members who must buy
|
|
6938
|
+
rewardLabel String // "Free drink", "VIP upgrade", "Free table"
|
|
6939
|
+
rewardType String // FreeDrink | VIPUpgrade | Merch | Custom
|
|
6940
|
+
expiresAt DateTime
|
|
6941
|
+
maxGroups Int? // null = unlimited
|
|
6942
|
+
createdAt DateTime @default(now())
|
|
6943
|
+
|
|
6944
|
+
bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
|
|
6945
|
+
ticketTier TicketTier? @relation(fields: [ticketTierId], references: [id])
|
|
6946
|
+
unlocks GroupUnlock[]
|
|
6947
|
+
|
|
6948
|
+
@@index([bashEventId])
|
|
6949
|
+
@@index([expiresAt])
|
|
6950
|
+
}
|
|
6951
|
+
|
|
6952
|
+
// Record of a group claiming an unlock offer
|
|
6953
|
+
model GroupUnlock {
|
|
6954
|
+
id String @id @default(cuid())
|
|
6955
|
+
offerId String
|
|
6956
|
+
groupId String
|
|
6957
|
+
unlockedAt DateTime @default(now())
|
|
6958
|
+
|
|
6959
|
+
offer GroupUnlockOffer @relation(fields: [offerId], references: [id], onDelete: Cascade)
|
|
6960
|
+
group EventGroup @relation(fields: [groupId], references: [id], onDelete: Cascade)
|
|
6961
|
+
|
|
6962
|
+
@@unique([offerId, groupId])
|
|
6963
|
+
@@index([groupId])
|
|
6964
|
+
}
|
package/src/definitions.ts
CHANGED
|
@@ -28,8 +28,8 @@ export const PASSWORD_REQUIREMENTS_REGEX = new RegExp(
|
|
|
28
28
|
);
|
|
29
29
|
|
|
30
30
|
// Stripe checkout timeout constants
|
|
31
|
-
export const STRIPE_CHECKOUT_TIMEOUT_MS = 20000 as const; //
|
|
32
|
-
export const STRIPE_REDIRECT_TIMEOUT_MS = 10000 as const; //
|
|
31
|
+
export const STRIPE_CHECKOUT_TIMEOUT_MS = 20000 as const; // 20 seconds
|
|
32
|
+
export const STRIPE_REDIRECT_TIMEOUT_MS = 10000 as const; // 10 seconds for redirect
|
|
33
33
|
export const STRIPE_API_TIMEOUT_MS = 15000 as const; // 15 seconds for API calls
|
|
34
34
|
|
|
35
35
|
export const URL_PARAMS_BASH_EVENT_ID = "bashEventId" as const;
|
|
@@ -231,25 +231,6 @@ export const DONATION_CHECKOUT_RETURN_SUCCESS_URL_PAGE =
|
|
|
231
231
|
export const DONATION_CHECKOUT_RETURN_CANCEL_URL_PAGE =
|
|
232
232
|
"/bash/${bashEventIdSlug}/donation-cancel/${checkoutSessionId}" as const;
|
|
233
233
|
|
|
234
|
-
// export const SERVICE_BOOKING_CHECKOUT_RETURN_SUCCESS_URL = urlAppendQueryParam(
|
|
235
|
-
// `/service/{SERVICE_ID}/booking/{BOOKING_ID}/checkout-return/{CHECKOUT_SESSION_ID}`,
|
|
236
|
-
// [
|
|
237
|
-
// {
|
|
238
|
-
// key: URL_PARAMS_STRIPE_CHECKOUT,
|
|
239
|
-
// value: URL_PARAMS_STRIPE_CHECKOUT_OPTIONS.complete,
|
|
240
|
-
// },
|
|
241
|
-
// ]
|
|
242
|
-
// );
|
|
243
|
-
// export const SERVICE_BOOKING_CHECKOUT_RETURN_CANCEL_URL = urlAppendQueryParam(
|
|
244
|
-
// `/service/{SERVICE_ID}/booking/{BOOKING_ID}/checkout-return/{CHECKOUT_SESSION_ID}`,
|
|
245
|
-
// [
|
|
246
|
-
// {
|
|
247
|
-
// key: URL_PARAMS_STRIPE_CHECKOUT,
|
|
248
|
-
// value: URL_PARAMS_STRIPE_CHECKOUT_OPTIONS.incomplete,
|
|
249
|
-
// },
|
|
250
|
-
// ]
|
|
251
|
-
// );
|
|
252
|
-
|
|
253
234
|
export const SERVICE_BOOKING_CHECKOUT_RETURN_SUCCESS_URL =
|
|
254
235
|
"/service/${SERVICE_ID}/${SERVICE_TYPE}/${SPECIFIC_ID}/booking/${BOOKING_ID}/checkout-return/success/{CHECKOUT_SESSION_ID}" as const; //CHECKOUT_SESSION_ID filled by stripe
|
|
255
236
|
export const SERVICE_BOOKING_CHECKOUT_RETURN_CANCEL_URL =
|
|
@@ -322,17 +303,6 @@ export const SERVICE_LINK_DATA_TO_INCLUDE = {
|
|
|
322
303
|
link: true,
|
|
323
304
|
} satisfies Prisma.ServiceLinkInclude;
|
|
324
305
|
|
|
325
|
-
// export type ServiceSpecificName = keyof Pick<
|
|
326
|
-
// ServiceExt,
|
|
327
|
-
// "eventService" |
|
|
328
|
-
// "entertainmentService" |
|
|
329
|
-
// "vendor" |
|
|
330
|
-
// "exhibitor" |
|
|
331
|
-
// "sponsor" |
|
|
332
|
-
// "venue" |
|
|
333
|
-
// "organization"
|
|
334
|
-
// >;
|
|
335
|
-
|
|
336
306
|
export type DateTimeArgType = Date | string | undefined | null;
|
|
337
307
|
export type RequiredStripeInfoMissingErrorDataType = {
|
|
338
308
|
[k in keyof User]?: { type: string; label: string };
|
|
@@ -365,6 +335,12 @@ export type TicketTierWherePriceIsAString = Omit<TicketTier, "price"> & {
|
|
|
365
335
|
price: string;
|
|
366
336
|
pricingType?: string; // 'USD' or 'BASHPOINTS'
|
|
367
337
|
priceBashPoints?: string; // Price in BashPoints credits (string for form input)
|
|
338
|
+
availabilityType?: string;
|
|
339
|
+
availableAt?: Date | string | null;
|
|
340
|
+
availableWhenInterestReached?: number | null;
|
|
341
|
+
unlockWhenTicketsSold?: number | null;
|
|
342
|
+
maxTicketsPerUser?: number | null;
|
|
343
|
+
tierPrivacy?: "Public" | "InviteOnly" | "LinkOnly";
|
|
368
344
|
} & { cannotDelete: boolean };
|
|
369
345
|
|
|
370
346
|
export type ApiServiceAddonParams = {
|
|
@@ -535,9 +511,21 @@ export interface NumberOfTicketsForDate {
|
|
|
535
511
|
ticketDateTime: DateTimeArgType;
|
|
536
512
|
}
|
|
537
513
|
|
|
514
|
+
export interface TicketTierAvailability {
|
|
515
|
+
available: boolean;
|
|
516
|
+
reason?: "OnDate" | "EngagedUsersOnly" | "UnlockWhenInterestReached" | "UnlockWhenTicketsSold";
|
|
517
|
+
availableAt?: string; // ISO string, OnDate
|
|
518
|
+
interestCount?: number; // current count, UnlockWhenInterestReached
|
|
519
|
+
interestThreshold?: number; // target, UnlockWhenInterestReached
|
|
520
|
+
ticketsSoldCount?: number; // current count, UnlockWhenTicketsSold
|
|
521
|
+
ticketsSoldThreshold?: number; // target, UnlockWhenTicketsSold
|
|
522
|
+
isViewerEngaged?: boolean; // EngagedUsersOnly — undefined if not logged in
|
|
523
|
+
}
|
|
524
|
+
|
|
538
525
|
export interface AvailableTicketsForTicketTier {
|
|
539
526
|
ticketTier: TicketTier;
|
|
540
527
|
availableTickets: NumberOfTicketsForDate[];
|
|
528
|
+
availability?: TicketTierAvailability;
|
|
541
529
|
}
|
|
542
530
|
|
|
543
531
|
export interface AvailableTicketsForTicketTierForDate {
|
|
@@ -545,37 +533,11 @@ export interface AvailableTicketsForTicketTierForDate {
|
|
|
545
533
|
availableTicketsForDate: NumberOfTicketsForDate;
|
|
546
534
|
}
|
|
547
535
|
|
|
548
|
-
export interface AvailableTicketsForTicketTier {
|
|
549
|
-
ticketTier: TicketTier;
|
|
550
|
-
availableTickets: NumberOfTicketsForDate[];
|
|
551
|
-
}
|
|
552
|
-
|
|
553
536
|
export interface NumberOfHoursForDate {
|
|
554
537
|
numberOfHours: number;
|
|
555
538
|
bookingDateTime: DateTimeArgType;
|
|
556
539
|
}
|
|
557
540
|
|
|
558
|
-
// export interface AvailableNumberOfHoursForRate {
|
|
559
|
-
// rate: Rate;
|
|
560
|
-
// availableHours: NumberOfHoursForDate[];
|
|
561
|
-
// }
|
|
562
|
-
|
|
563
|
-
// export interface AvailableHoursForRateForDate {
|
|
564
|
-
// rate: Rate,
|
|
565
|
-
// availableHoursForDate: NumberOfHoursForDate;
|
|
566
|
-
// }
|
|
567
|
-
|
|
568
|
-
// export interface AvailableHoursForRate {
|
|
569
|
-
// rate: Rate;
|
|
570
|
-
// availableHours: NumberOfHoursForDate[];
|
|
571
|
-
// }
|
|
572
|
-
|
|
573
|
-
// export interface DeletedAndHiddenRates {
|
|
574
|
-
// deletedRates: Rate[];
|
|
575
|
-
// hiddenRates: Rate[];
|
|
576
|
-
// errorType?: ApiErrorType;
|
|
577
|
-
// }
|
|
578
|
-
|
|
579
541
|
export interface SignInEmailWithPassword {
|
|
580
542
|
email: string;
|
|
581
543
|
password: string;
|
|
@@ -696,6 +658,11 @@ export interface StripeCreateBashEventTicketsCheckoutSessionArgs {
|
|
|
696
658
|
bashPointsReservationId?: string; // Reservation ID from /bashpoints/reserve-for-checkout
|
|
697
659
|
bashPointsTicketListStr?: string; // Ticket list for BashPoints portion
|
|
698
660
|
bashPointsAmount?: number; // Total BashPoints reserved
|
|
661
|
+
|
|
662
|
+
// Per-event referral: userId of attendee who shared the link
|
|
663
|
+
referrerId?: string;
|
|
664
|
+
// Attribution ref from URL (referral code or userId) - backend resolves to referrerId
|
|
665
|
+
attributionRef?: string;
|
|
699
666
|
}
|
|
700
667
|
|
|
701
668
|
export interface StripeCreateBashEventDonationCheckoutSessionArgs {
|
|
@@ -750,26 +717,11 @@ export interface ServiceGenerateCoverPhotoArgs {
|
|
|
750
717
|
searchTerm: string;
|
|
751
718
|
}
|
|
752
719
|
|
|
753
|
-
export interface ServiceNextGooglePhotoArgs {
|
|
754
|
-
photoIndex: string;
|
|
755
|
-
useBusinessPhotos: boolean;
|
|
756
|
-
}
|
|
757
|
-
|
|
758
720
|
export type StripeSessionRedirect = {
|
|
759
721
|
stripeAccountIdDB: string;
|
|
760
722
|
redirectUrl: string;
|
|
761
723
|
};
|
|
762
724
|
|
|
763
|
-
// export type ServiceStripeSessionRedirect = {
|
|
764
|
-
// service: ServiceExt;
|
|
765
|
-
// } & StripeSessionRedirect;
|
|
766
|
-
|
|
767
|
-
// export type BashEventStripeSessionRedirect = {
|
|
768
|
-
// bashEvent: BashEventExt;
|
|
769
|
-
// } & StripeSessionRedirect;
|
|
770
|
-
|
|
771
|
-
// export type StripeLinkingStatus = "Complete" | "Incomplete";
|
|
772
|
-
|
|
773
725
|
export type StripeAddress = {
|
|
774
726
|
line1: string;
|
|
775
727
|
line2: string;
|
package/src/extendedSchemas.ts
CHANGED
|
@@ -712,7 +712,7 @@ export interface ServiceExt extends Service {
|
|
|
712
712
|
// bookedCheckouts: ServiceBookingCheckoutExt[]; //not necessary to include
|
|
713
713
|
}
|
|
714
714
|
|
|
715
|
-
export type ServiceExtNonSpecific =
|
|
715
|
+
export type ServiceExtNonSpecific = Omit<
|
|
716
716
|
ServiceExt,
|
|
717
717
|
| "id"
|
|
718
718
|
| "venue"
|
|
@@ -735,7 +735,7 @@ export type ServiceExtNonSpecific = Exclude<
|
|
|
735
735
|
| "bashEventId"
|
|
736
736
|
>;
|
|
737
737
|
|
|
738
|
-
export type ServiceExtNoIds =
|
|
738
|
+
export type ServiceExtNoIds = Omit<
|
|
739
739
|
ServiceExt,
|
|
740
740
|
| "id"
|
|
741
741
|
| "venueId"
|
package/src/index.ts
CHANGED
|
@@ -31,7 +31,6 @@ export * from "./utils/ticketListUtils";
|
|
|
31
31
|
export * from "./utils/urlUtils";
|
|
32
32
|
export * from "./utils/userPromoCodeUtils";
|
|
33
33
|
export * from "./utils/userSubscriptionUtils";
|
|
34
|
-
// export * from "./utils/service/serviceRateDBUtils";
|
|
35
34
|
export * from "./utils/blog/blogDbUtils";
|
|
36
35
|
export * from "./utils/blogUtils";
|
|
37
36
|
export * from "./utils/entityUtils";
|
|
@@ -51,11 +51,19 @@ export interface CreateMembershipPaymentIntentArgs {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
export interface MembershipPaymentIntentResult {
|
|
54
|
+
paymentIntentId?: string;
|
|
54
55
|
clientSecret: string;
|
|
55
56
|
amount: number;
|
|
56
57
|
currency: string;
|
|
57
58
|
}
|
|
58
59
|
|
|
60
|
+
/** Legacy shape for deprecated createMembershipPaymentIntent endpoint (tierName/interval). */
|
|
61
|
+
export interface CreateMembershipPaymentIntentArgsLegacy {
|
|
62
|
+
tierName: string;
|
|
63
|
+
interval?: "monthly" | "yearly";
|
|
64
|
+
currency?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
59
67
|
export interface MembershipFeatureAccessCheck {
|
|
60
68
|
hasAccess: boolean;
|
|
61
69
|
requiredTier?: MembershipTier;
|
|
@@ -914,17 +922,3 @@ export interface ConfirmMembershipPaymentArgs {
|
|
|
914
922
|
interval?: 'monthly' | 'yearly';
|
|
915
923
|
userId?: string;
|
|
916
924
|
}
|
|
917
|
-
|
|
918
|
-
export interface CreateMembershipPaymentIntentArgs {
|
|
919
|
-
tierName: string;
|
|
920
|
-
interval?: 'monthly' | 'yearly';
|
|
921
|
-
paymentMethodId?: string;
|
|
922
|
-
userId?: string;
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
export interface MembershipPaymentIntentResult {
|
|
926
|
-
paymentIntentId: string;
|
|
927
|
-
clientSecret: string;
|
|
928
|
-
amount: number;
|
|
929
|
-
currency: string;
|
|
930
|
-
}
|
package/src/utils/index.ts
CHANGED
|
@@ -25,7 +25,6 @@ export * from './service/regexUtils';
|
|
|
25
25
|
export * from './service/serviceBookingStatusUtils';
|
|
26
26
|
export * from './service/serviceBookingTypes';
|
|
27
27
|
export * from './service/serviceDBUtils';
|
|
28
|
-
// export * from './service/serviceRateDBUtils'; // File is all commented out
|
|
29
28
|
export * from './service/serviceRateTypes';
|
|
30
29
|
export * from './service/serviceRateUtils';
|
|
31
30
|
export * from './service/serviceUtils';
|