@bash-app/bash-common 30.154.0 → 30.157.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.
Files changed (37) hide show
  1. package/dist/definitions.d.ts +19 -8
  2. package/dist/definitions.d.ts.map +1 -1
  3. package/dist/definitions.js +2 -20
  4. package/dist/definitions.js.map +1 -1
  5. package/dist/extendedSchemas.d.ts +2 -2
  6. package/dist/extendedSchemas.d.ts.map +1 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +0 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/membershipDefinitions.d.ts +7 -12
  11. package/dist/membershipDefinitions.d.ts.map +1 -1
  12. package/dist/membershipDefinitions.js.map +1 -1
  13. package/dist/utils/index.d.ts.map +1 -1
  14. package/dist/utils/index.js +0 -1
  15. package/dist/utils/index.js.map +1 -1
  16. package/dist/utils/luxonUtils.d.ts.map +1 -1
  17. package/dist/utils/luxonUtils.js +1 -73
  18. package/dist/utils/luxonUtils.js.map +1 -1
  19. package/dist/utils/service/serviceDBUtils.d.ts +2 -0
  20. package/dist/utils/service/serviceDBUtils.d.ts.map +1 -1
  21. package/dist/utils/service/serviceDBUtils.js +2 -41
  22. package/dist/utils/service/serviceDBUtils.js.map +1 -1
  23. package/package.json +1 -1
  24. package/prisma/migrations/add_bash_availability.sql +53 -0
  25. package/prisma/migrations/add_groups_and_momentum.sql +135 -0
  26. package/prisma/migrations/add_groups_momentum_phase0_4.sql +200 -0
  27. package/prisma/migrations/add_new_feature_tables.sql +140 -0
  28. package/prisma/migrations/add_tier_privacy_and_fee_handling.sql +29 -0
  29. package/prisma/schema.prisma +242 -0
  30. package/src/definitions.ts +25 -73
  31. package/src/extendedSchemas.ts +2 -2
  32. package/src/index.ts +0 -1
  33. package/src/membershipDefinitions.ts +8 -14
  34. package/src/utils/index.ts +0 -1
  35. package/src/utils/luxonUtils.ts +1 -111
  36. package/src/utils/service/serviceDBUtils.ts +2 -41
  37. package/src/utils/service/serviceRateDBUtils.ts +0 -179
@@ -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 {
@@ -5740,6 +5873,7 @@ enum BirthdayFreebieCategory {
5740
5873
  enum BirthdayFreebieExpirationType {
5741
5874
  DayOf
5742
5875
  Valid30Days
5876
+ ValidDays
5743
5877
  }
5744
5878
 
5745
5879
  enum BirthdayOfferQualityTier {
@@ -5786,6 +5920,8 @@ model BirthdayFreebieCatalog {
5786
5920
  qualityTier BirthdayOfferQualityTier? // Awesome / Okay / Lame — set by super users on approve
5787
5921
  address String? @db.Text // For Maps and display
5788
5922
  redemptionNotes String? @db.Text // Conditions, limitations
5923
+ expirationDays Int? // when Valid30Days with custom count
5924
+ isNational Boolean @default(false)
5789
5925
  createdAt DateTime @default(now())
5790
5926
  updatedAt DateTime @updatedAt
5791
5927
 
@@ -5795,6 +5931,7 @@ model BirthdayFreebieCatalog {
5795
5931
 
5796
5932
  @@index([stateSlug, citySlug])
5797
5933
  @@index([isActive])
5934
+ @@index([isNational])
5798
5935
  @@index([sector])
5799
5936
  }
5800
5937
 
@@ -6717,3 +6854,108 @@ model BashAvailability {
6717
6854
 
6718
6855
  @@index([city, window, expiresAt])
6719
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
6881
+ WantsToGo // Interested, no ticket yet
6882
+ Invited // Invited by owner, not yet responded
6883
+ }
6884
+
6885
+ // A group of attendees for a specific event
6886
+ model EventGroup {
6887
+ id String @id @default(cuid())
6888
+ bashEventId String
6889
+ ownerId String
6890
+ name String? // e.g. "Steve's Birthday Group", "Weber State Crew"
6891
+ maxMembers Int? // null = unlimited
6892
+ visibility GroupVisibility @default(Private)
6893
+ promoterId String? // Optional: links to event promoter for display context
6894
+ createdAt DateTime @default(now())
6895
+ updatedAt DateTime @updatedAt
6896
+
6897
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
6898
+ owner User @relation("OwnedGroups", fields: [ownerId], references: [id], onDelete: Cascade)
6899
+ members GroupMember[]
6900
+ unlocks GroupUnlock[]
6901
+
6902
+ @@unique([bashEventId, ownerId])
6903
+ @@index([bashEventId])
6904
+ @@index([ownerId])
6905
+ }
6906
+
6907
+ // Membership record within a group
6908
+ model GroupMember {
6909
+ id String @id @default(cuid())
6910
+ groupId String
6911
+ userId String
6912
+ status GroupMemberStatus @default(Invited)
6913
+ ticketId String? // Set when status = Going
6914
+ joinedAt DateTime @default(now())
6915
+
6916
+ group EventGroup @relation(fields: [groupId], references: [id], onDelete: Cascade)
6917
+ user User @relation("GroupMemberships", fields: [userId], references: [id], onDelete: Cascade)
6918
+
6919
+ @@unique([groupId, userId])
6920
+ @@index([groupId])
6921
+ @@index([userId])
6922
+ }
6923
+
6924
+ // ─── Phase 1.5: Promoter Leaderboards ───────────────────────────────────────
6925
+ // topPromoterPrize and promoterLeaderboardIsPublic are added to BashEvent via migration SQL.
6926
+
6927
+ // ─── Phase 4: Group Unlock Incentives ───────────────────────────────────────
6928
+
6929
+ // Host-created time-limited offer targeting a specific group
6930
+ model GroupUnlockOffer {
6931
+ id String @id @default(cuid())
6932
+ bashEventId String
6933
+ ticketTierId String? // Optional: scoped to a specific tier
6934
+ minGroupSize Int // Minimum members who must buy
6935
+ rewardLabel String // "Free drink", "VIP upgrade", "Free table"
6936
+ rewardType String // FreeDrink | VIPUpgrade | Merch | Custom
6937
+ expiresAt DateTime
6938
+ maxGroups Int? // null = unlimited
6939
+ createdAt DateTime @default(now())
6940
+
6941
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
6942
+ ticketTier TicketTier? @relation(fields: [ticketTierId], references: [id])
6943
+ unlocks GroupUnlock[]
6944
+
6945
+ @@index([bashEventId])
6946
+ @@index([expiresAt])
6947
+ }
6948
+
6949
+ // Record of a group claiming an unlock offer
6950
+ model GroupUnlock {
6951
+ id String @id @default(cuid())
6952
+ offerId String
6953
+ groupId String
6954
+ unlockedAt DateTime @default(now())
6955
+
6956
+ offer GroupUnlockOffer @relation(fields: [offerId], references: [id], onDelete: Cascade)
6957
+ group EventGroup @relation(fields: [groupId], references: [id], onDelete: Cascade)
6958
+
6959
+ @@unique([offerId, groupId])
6960
+ @@index([groupId])
6961
+ }
@@ -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; // 10 seconds (more reasonable)
32
- export const STRIPE_REDIRECT_TIMEOUT_MS = 10000 as const; // 5 seconds for redirect
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;
@@ -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 = Exclude<
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 = Exclude<
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
- }
@@ -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';