@bash-app/bash-common 30.44.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 +1 -1
- package/prisma/schema.prisma +70 -16
- package/src/utils/luxonUtils.ts +26 -8
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -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?
|
|
@@ -1107,10 +1109,10 @@ model User {
|
|
|
1107
1109
|
following UserFollowing[] @relation("Follower")
|
|
1108
1110
|
|
|
1109
1111
|
// For lightweight sign-up
|
|
1110
|
-
isLightweightAccount Boolean
|
|
1111
|
-
notifyForTrendingBashes Boolean
|
|
1112
|
-
trendingBashThreshold Int
|
|
1113
|
-
organizerUser
|
|
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")
|
|
1114
1116
|
}
|
|
1115
1117
|
|
|
1116
1118
|
model UserPreferences {
|
|
@@ -1184,17 +1186,17 @@ model UserPreferences {
|
|
|
1184
1186
|
}
|
|
1185
1187
|
|
|
1186
1188
|
model UserFollowing {
|
|
1187
|
-
id
|
|
1188
|
-
userId
|
|
1189
|
-
followingId
|
|
1190
|
-
isFollowing
|
|
1191
|
-
followedAt
|
|
1192
|
-
unfollowedAt
|
|
1193
|
-
isOrganizer
|
|
1194
|
-
lastNotified
|
|
1195
|
-
|
|
1196
|
-
user
|
|
1197
|
-
following
|
|
1189
|
+
id String @id @default(cuid())
|
|
1190
|
+
userId String
|
|
1191
|
+
followingId String
|
|
1192
|
+
isFollowing Boolean @default(true)
|
|
1193
|
+
followedAt DateTime?
|
|
1194
|
+
unfollowedAt DateTime?
|
|
1195
|
+
isOrganizer Boolean @default(false) // Flag if following as organizer
|
|
1196
|
+
lastNotified DateTime? // For organizer notifications
|
|
1197
|
+
|
|
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)
|
|
1198
1200
|
organizerUser User? @relation("FollowingOrganizers", fields: [userId], references: [id], onDelete: Cascade, map: "UserFollowing_organizer_fkey")
|
|
1199
1201
|
|
|
1200
1202
|
@@unique([userId, followingId])
|
|
@@ -1565,6 +1567,8 @@ model Vendor {
|
|
|
1565
1567
|
id String @id @default(cuid())
|
|
1566
1568
|
serviceRangeId String?
|
|
1567
1569
|
serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
|
|
1570
|
+
vendorServiceTypes VendorServiceType[]
|
|
1571
|
+
vendorServiceSubType String?
|
|
1568
1572
|
yearsOfExperience YearsOfExperience
|
|
1569
1573
|
crowdSizeId String? @unique
|
|
1570
1574
|
crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
|
|
@@ -1679,7 +1683,9 @@ enum EventServiceType {
|
|
|
1679
1683
|
InteriorDesigner
|
|
1680
1684
|
RentalEquipmentProvider
|
|
1681
1685
|
FoodAndBeverageProvider
|
|
1682
|
-
|
|
1686
|
+
Photographer
|
|
1687
|
+
Videographer
|
|
1688
|
+
MediaEditor
|
|
1683
1689
|
AVTechnician
|
|
1684
1690
|
GraphicDesigner
|
|
1685
1691
|
Influencer
|
|
@@ -1690,6 +1696,7 @@ enum EventServiceType {
|
|
|
1690
1696
|
VirtualAssistant
|
|
1691
1697
|
Consulting
|
|
1692
1698
|
Transportation
|
|
1699
|
+
Other
|
|
1693
1700
|
}
|
|
1694
1701
|
|
|
1695
1702
|
enum EntertainmentServiceType {
|
|
@@ -1706,8 +1713,54 @@ enum EntertainmentServiceType {
|
|
|
1706
1713
|
Impersonators
|
|
1707
1714
|
Speakers
|
|
1708
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
|
|
1743
|
+
}
|
|
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
|
|
1709
1761
|
}
|
|
1710
1762
|
|
|
1763
|
+
|
|
1711
1764
|
enum OrganizationType {
|
|
1712
1765
|
Church
|
|
1713
1766
|
GreekLife
|
|
@@ -1727,6 +1780,7 @@ enum OrganizationType {
|
|
|
1727
1780
|
Conference
|
|
1728
1781
|
FoodAndBeverage
|
|
1729
1782
|
TechAndStartups
|
|
1783
|
+
Other
|
|
1730
1784
|
}
|
|
1731
1785
|
|
|
1732
1786
|
enum YearsOfExperience {
|
package/src/utils/luxonUtils.ts
CHANGED
|
@@ -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
|
|
200
|
-
return dateTime?.
|
|
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 input
|
|
907
|
-
* start time as the daily
|
|
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 day
|
|
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
|
|
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 segment
|
|
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 segment
|
|
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
|
}
|