@bash-app/bash-common 30.42.0 → 30.45.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash-app/bash-common",
3
- "version": "30.42.0",
3
+ "version": "30.45.0",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -274,6 +274,7 @@ model BashEvent {
274
274
  isApproved Boolean? @default(false)
275
275
  description String?
276
276
  eventType String @default("Other")
277
+ timezone String?
277
278
  startDateTime DateTime? @default(now())
278
279
  endDateTime DateTime? @default(now())
279
280
  waiverUrl String?
@@ -1005,6 +1006,7 @@ model User {
1005
1006
  googleCalendarAccess String?
1006
1007
  givenName String?
1007
1008
  familyName String?
1009
+ nameChangeCount Int @default(0)
1008
1010
  hash String?
1009
1011
  emailVerified DateTime?
1010
1012
  image String?
@@ -1067,9 +1069,7 @@ model User {
1067
1069
  contactlist ContactList[]
1068
1070
 
1069
1071
  bashEventPromoCodesIUsed BashEventPromoCode[]
1070
- // bookingForMe Booking[]
1071
1072
  userSubscription UserSubscription?
1072
- // serviceSubscriptions ServiceSubscription[]
1073
1073
  volunteerService VolunteerService[]
1074
1074
  stripeAccounts StripeAccount[]
1075
1075
  userPromoCodeRedemption UserPromoCodeRedemption[]
@@ -1092,13 +1092,11 @@ model User {
1092
1092
  preferences UserPreferences?
1093
1093
  userStats UserStats?
1094
1094
 
1095
- // Add fields for user suspension
1096
1095
  suspendedUntil DateTime?
1097
1096
  suspendedById String?
1098
1097
  suspendedBy User? @relation("SuspendedUsers", fields: [suspendedById], references: [id], onDelete: SetNull)
1099
1098
  suspendedUsers User[] @relation("SuspendedUsers")
1100
1099
 
1101
- // Add relations for reports and demerits
1102
1100
  reportsMade UserReport[] @relation("ReportsMade")
1103
1101
  reportsReceived UserReport[] @relation("ReportsReceived")
1104
1102
  reportsReviewed UserReport[] @relation("ReportsReviewed")
@@ -1109,6 +1107,12 @@ model User {
1109
1107
  notification Notification[] @relation("NotificationsReceivedByMe")
1110
1108
  followers UserFollowing[] @relation("Following")
1111
1109
  following UserFollowing[] @relation("Follower")
1110
+
1111
+ // For lightweight sign-up
1112
+ isLightweightAccount Boolean @default(false)
1113
+ notifyForTrendingBashes Boolean @default(false)
1114
+ trendingBashThreshold Int @default(10) // Min attendees to trigger notification
1115
+ organizerUser UserFollowing[] @relation("FollowingOrganizers")
1112
1116
  }
1113
1117
 
1114
1118
  model UserPreferences {
@@ -1127,6 +1131,8 @@ model UserPreferences {
1127
1131
  invitationNotify Boolean @default(true)
1128
1132
  eventUpdatesNotify Boolean @default(true)
1129
1133
  servicePromotionsNotify Boolean @default(true)
1134
+ trendingBashesNotify Boolean @default(false) // New field
1135
+ organizerUpdatesNotify Boolean @default(false) // New field
1130
1136
 
1131
1137
  // Privacy Settings
1132
1138
  profileVisibility String @default("PUBLIC") // PUBLIC, FRIENDS, PRIVATE
@@ -1186,9 +1192,12 @@ model UserFollowing {
1186
1192
  isFollowing Boolean @default(true)
1187
1193
  followedAt DateTime?
1188
1194
  unfollowedAt DateTime?
1195
+ isOrganizer Boolean @default(false) // Flag if following as organizer
1196
+ lastNotified DateTime? // For organizer notifications
1189
1197
 
1190
- user User @relation("Follower", fields: [userId], references: [id], onDelete: Cascade)
1191
- following User @relation("Following", fields: [followingId], references: [id], onDelete: Cascade)
1198
+ user User @relation("Follower", fields: [userId], references: [id], onDelete: Cascade, map: "UserFollowing_follower_fkey")
1199
+ following User @relation("Following", fields: [followingId], references: [id], onDelete: Cascade)
1200
+ organizerUser User? @relation("FollowingOrganizers", fields: [userId], references: [id], onDelete: Cascade, map: "UserFollowing_organizer_fkey")
1192
1201
 
1193
1202
  @@unique([userId, followingId])
1194
1203
  }
@@ -1558,6 +1567,8 @@ model Vendor {
1558
1567
  id String @id @default(cuid())
1559
1568
  serviceRangeId String?
1560
1569
  serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1570
+ vendorServiceTypes VendorServiceType[]
1571
+ vendorServiceSubType String?
1561
1572
  yearsOfExperience YearsOfExperience
1562
1573
  crowdSizeId String? @unique
1563
1574
  crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
@@ -1672,7 +1683,9 @@ enum EventServiceType {
1672
1683
  InteriorDesigner
1673
1684
  RentalEquipmentProvider
1674
1685
  FoodAndBeverageProvider
1675
- MediaCapture
1686
+ Photographer
1687
+ Videographer
1688
+ MediaEditor
1676
1689
  AVTechnician
1677
1690
  GraphicDesigner
1678
1691
  Influencer
@@ -1683,6 +1696,7 @@ enum EventServiceType {
1683
1696
  VirtualAssistant
1684
1697
  Consulting
1685
1698
  Transportation
1699
+ Other
1686
1700
  }
1687
1701
 
1688
1702
  enum EntertainmentServiceType {
@@ -1699,8 +1713,54 @@ enum EntertainmentServiceType {
1699
1713
  Impersonators
1700
1714
  Speakers
1701
1715
  Auctioneers
1716
+ Other
1717
+ }
1718
+
1719
+ enum VendedProductType {
1720
+ Art
1721
+ Books
1722
+ BakedGoods
1723
+ Beverages
1724
+ BodyCareProducts
1725
+ Candles
1726
+ Clothing
1727
+ Crystals
1728
+ FoodItems
1729
+ HandcraftedItems
1730
+ HerbalRemedies
1731
+ HomeDecor
1732
+ HoneyAndJams
1733
+ Jewelry
1734
+ PetProducts
1735
+ PhotographyPrints
1736
+ PopcornAndSnacks
1737
+ SkincareProducts
1738
+ SpiritualItems
1739
+ StickersAndStationery
1740
+ SweetTreats
1741
+ TShirtsAndApparel
1742
+ Other
1702
1743
  }
1703
1744
 
1745
+ enum VendorServiceType {
1746
+ BalloonArt
1747
+ CaricatureDrawings
1748
+ ChairMassages
1749
+ FacePainting
1750
+ HairBraiding
1751
+ HennaArt
1752
+ KidsCraftBooths
1753
+ LivePainting
1754
+ PettingZoos
1755
+ PhotoBooths
1756
+ PsychicOrTarotReadings
1757
+ TemporaryTattoos
1758
+ WellnessDemos
1759
+ YogaOrMovementClasses
1760
+ Other
1761
+ }
1762
+
1763
+
1704
1764
  enum OrganizationType {
1705
1765
  Church
1706
1766
  GreekLife
@@ -1720,6 +1780,7 @@ enum OrganizationType {
1720
1780
  Conference
1721
1781
  FoodAndBeverage
1722
1782
  TechAndStartups
1783
+ Other
1723
1784
  }
1724
1785
 
1725
1786
  enum YearsOfExperience {
@@ -196,14 +196,22 @@ export function dateTimeFormat(dateTime?: DateTime | null) {
196
196
  return dateTime?.toFormat(LUXON_DATETIME_FORMAT_STANDARD) ?? "";
197
197
  }
198
198
 
199
- export function dateTimeFormatTime(dateTime?: DateTime | null) {
200
- return dateTime?.toFormat(LUXON_TIME_FORMAT_AM_PM) ?? "";
199
+ export function dateTimeFormatLong(dateTime?: DateTime | null) {
200
+ return `${dateTime?.weekdayLong} ${dateTimeFormatWeek(dateTime)}`;
201
+ }
202
+
203
+ export function dateTimeFormatWeek(dateTime?: DateTime | null) {
204
+ return dateTime?.toFormat(LUXON_DATETIME_FORMAT_STANDARD) ?? "";
201
205
  }
202
206
 
203
207
  export function dateTimeFormatDate(dateTime?: DateTime | null) {
204
208
  return dateTime?.toFormat(LUXON_DATETIME_FORMAT_DATE) ?? "";
205
209
  }
206
210
 
211
+ export function dateTimeFormatTime(dateTime?: DateTime | null) {
212
+ return dateTime?.toFormat(LUXON_TIME_FORMAT_AM_PM) ?? "";
213
+ }
214
+
207
215
  export function dateTimeWithinRange(
208
216
  dateTime: DateTime,
209
217
  dateRange: LuxonDateRange
@@ -268,6 +276,16 @@ export function utcOffsetMinutesToTimezone(utcOffsetMinutes: number) {
268
276
  return offsetString;
269
277
  }
270
278
 
279
+ export function getLocalTimezone() {
280
+ const localDateTime = DateTime.local();
281
+ return utcOffsetMinutesToTimezone(localDateTime.offset);
282
+ }
283
+
284
+ export function getLocalTimezoneName() {
285
+ const localDateTime = DateTime.local();
286
+ return localDateTime.zoneName;
287
+ }
288
+
271
289
  export function dateTimeFormatDateRange(
272
290
  startDateTimeArg: DateTime | null,
273
291
  endDateTimeArg: DateTime | null
@@ -903,10 +921,10 @@ export function dateTimeRangeCrossesMidnight(range: LuxonDateRange) {
903
921
  }
904
922
 
905
923
  /**
906
- * Given an overall range, split it into segments that use the inputs
907
- * start time as the daily start and the inputs end time as the daily end.”
924
+ * Given an overall range, split it into segments that use the input's
925
+ * start time as the daily "start" and the input's end time as the daily "end."
908
926
  *
909
- * Each segment will run from a days daily start to the next days daily end.
927
+ * Each segment will run from a day's daily start to the next day's daily end.
910
928
  *
911
929
  * For example, if the overall range is:
912
930
  * start: March 5, 2025 11:00 am
@@ -918,7 +936,7 @@ export function dateTimeRangeCrossesMidnight(range: LuxonDateRange) {
918
936
  * March 7, 11:00 am – March 8, 9:00 pm
919
937
  * March 8, 11:00 am – March 9, 9:00 pm
920
938
  *
921
- * (You can then filter out partial segments if you want only full days”.)
939
+ * (You can then filter out partial segments if you want only full "days.")
922
940
  */
923
941
  export function splitRangeByInputTimes(
924
942
  range: LuxonDateRange
@@ -931,7 +949,7 @@ export function splitRangeByInputTimes(
931
949
  // Determine if the range crosses midnight.
932
950
  const crossesMidnight = dateTimeRangeCrossesMidnight(range);
933
951
 
934
- // Set the first segments start.
952
+ // Set the first segment's start.
935
953
  let currentStart = range.start.set(startTime);
936
954
  if (currentStart < range.start) {
937
955
  currentStart = currentStart.plus({ days: 1 });
@@ -949,7 +967,7 @@ export function splitRangeByInputTimes(
949
967
  }
950
968
  segments.push({ start: currentStart, end: currentEnd });
951
969
 
952
- // Move to the next segments start:
970
+ // Move to the next segment's start:
953
971
  // (Always add one day and then snap to the start time.)
954
972
  currentStart = currentStart.plus({ days: 1 }).set(startTime);
955
973
  }