@bash-app/bash-common 30.242.0 → 30.244.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 +49 -4
- package/dist/definitions.d.ts.map +1 -1
- package/dist/definitions.js +295 -88
- package/dist/definitions.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/templates/eventTemplates.js +16 -16
- package/dist/templates/eventTemplates.js.map +1 -1
- package/package.json +1 -1
- package/prisma/schema.prisma +56 -51
- package/src/definitions.ts +344 -95
- package/src/index.ts +2 -1
- package/src/templates/eventTemplates.ts +16 -16
package/src/definitions.ts
CHANGED
|
@@ -4,8 +4,9 @@ import {
|
|
|
4
4
|
BracketType,
|
|
5
5
|
CompetitionType,
|
|
6
6
|
Contact,
|
|
7
|
+
DietaryOption,
|
|
7
8
|
EntertainmentServiceType,
|
|
8
|
-
|
|
9
|
+
IncomeRange,
|
|
9
10
|
JudgingType,
|
|
10
11
|
MembershipTier,
|
|
11
12
|
MusicGenreType,
|
|
@@ -20,6 +21,7 @@ import type {
|
|
|
20
21
|
BashPassTier,
|
|
21
22
|
BashEventDressTags,
|
|
22
23
|
BashEventVibeTags,
|
|
24
|
+
GovIdRetentionPolicy as GovIdRetentionPolicyEnum,
|
|
23
25
|
ServiceBookingOfferDirection as ServiceBookingOfferDirectionEnum,
|
|
24
26
|
ServiceBookingOfferStatus as ServiceBookingOfferStatusEnum,
|
|
25
27
|
YearsOfExperience as YearsOfExperienceEnum,
|
|
@@ -68,6 +70,15 @@ export const YearsOfExperience = {
|
|
|
68
70
|
|
|
69
71
|
export type YearsOfExperience = YearsOfExperienceEnum;
|
|
70
72
|
|
|
73
|
+
/** Mirrors Prisma `GovIdRetentionPolicy` — `@prisma/client` browser/Jest bundles may omit runtime enum keys. */
|
|
74
|
+
export const GovIdRetentionPolicy = {
|
|
75
|
+
ThirtyDays: "ThirtyDays",
|
|
76
|
+
UntilIdExpires: "UntilIdExpires",
|
|
77
|
+
Indefinite: "Indefinite",
|
|
78
|
+
} as const satisfies Record<GovIdRetentionPolicyEnum, GovIdRetentionPolicyEnum>;
|
|
79
|
+
|
|
80
|
+
export type GovIdRetentionPolicy = GovIdRetentionPolicyEnum;
|
|
81
|
+
|
|
71
82
|
export const PASSWORD_MIN_LENGTH = 8 as const;
|
|
72
83
|
export const PASSWORD_REQUIREMENTS_REGEX = new RegExp(
|
|
73
84
|
String.raw`^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&^#])[A-Za-z\d@$!%*?&^#]{${PASSWORD_MIN_LENGTH},}$`
|
|
@@ -490,11 +501,59 @@ export type FilterFields = {
|
|
|
490
501
|
hostRating: string[];
|
|
491
502
|
specialOffers: string[];
|
|
492
503
|
eventFormat: string[];
|
|
504
|
+
/// Positive-framed dietary accommodations (e.g. "GlutenFreeOptions") the guest is
|
|
505
|
+
/// filtering for; values come from the `DietaryOption` enum and match
|
|
506
|
+
/// `BashEvent.dietaryOptions`. An event passes when it offers at least one
|
|
507
|
+
/// of the selected options.
|
|
508
|
+
dietaryOptions: string[];
|
|
509
|
+
/// Income brackets the host selected on `TargetAudience` (plus secondary).
|
|
510
|
+
/// Marketing / discovery only — same string values as `IncomeRange` enum.
|
|
511
|
+
incomeRange: string[];
|
|
493
512
|
hasOpenTasks: boolean; // Boolean filter for events with open volunteer tasks
|
|
494
513
|
acceptsBashPoints: boolean; // Boolean filter for events with BashPoints-priced tickets
|
|
495
514
|
ambashadorOnly: boolean; // Boolean filter for events created by Ambashadors
|
|
496
515
|
};
|
|
497
516
|
|
|
517
|
+
/** Default filter state for feed / modals; keep in sync with `FilterFields`. */
|
|
518
|
+
export const EMPTY_FILTER_FIELDS: FilterFields = {
|
|
519
|
+
price: [],
|
|
520
|
+
ageRequirement: [],
|
|
521
|
+
allowed: [],
|
|
522
|
+
notAllowed: [],
|
|
523
|
+
crowd: [],
|
|
524
|
+
vibe: [],
|
|
525
|
+
included: [],
|
|
526
|
+
hostRating: [],
|
|
527
|
+
specialOffers: [],
|
|
528
|
+
eventFormat: [],
|
|
529
|
+
dietaryOptions: [],
|
|
530
|
+
incomeRange: [],
|
|
531
|
+
hasOpenTasks: false,
|
|
532
|
+
acceptsBashPoints: false,
|
|
533
|
+
ambashadorOnly: false,
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
/** Fresh filter state — use for `useState` / reset so nested arrays are not shared. */
|
|
537
|
+
export function createEmptyFilterFields(): FilterFields {
|
|
538
|
+
return {
|
|
539
|
+
price: [],
|
|
540
|
+
ageRequirement: [],
|
|
541
|
+
allowed: [],
|
|
542
|
+
notAllowed: [],
|
|
543
|
+
crowd: [],
|
|
544
|
+
vibe: [],
|
|
545
|
+
included: [],
|
|
546
|
+
hostRating: [],
|
|
547
|
+
specialOffers: [],
|
|
548
|
+
eventFormat: [],
|
|
549
|
+
dietaryOptions: [],
|
|
550
|
+
incomeRange: [],
|
|
551
|
+
hasOpenTasks: false,
|
|
552
|
+
acceptsBashPoints: false,
|
|
553
|
+
ambashadorOnly: false,
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
|
|
498
557
|
export type ApiEntityApproval = {
|
|
499
558
|
isApproved: boolean;
|
|
500
559
|
};
|
|
@@ -1059,7 +1118,6 @@ export {
|
|
|
1059
1118
|
BracketType,
|
|
1060
1119
|
CompetitionType,
|
|
1061
1120
|
EntertainmentServiceType,
|
|
1062
|
-
GovIdRetentionPolicy,
|
|
1063
1121
|
JudgingType,
|
|
1064
1122
|
MusicGenreType,
|
|
1065
1123
|
SchoolNameSource,
|
|
@@ -1073,7 +1131,7 @@ export {
|
|
|
1073
1131
|
* like `"30days"`; use `GovIdRetentionPolicy.ThirtyDays` instead so a typo can't quietly
|
|
1074
1132
|
* mismatch on either the API or DB side.
|
|
1075
1133
|
*/
|
|
1076
|
-
export const GovIdRetentionPolicyLabel: Record<
|
|
1134
|
+
export const GovIdRetentionPolicyLabel: Record<GovIdRetentionPolicyEnum, string> = {
|
|
1077
1135
|
[GovIdRetentionPolicy.ThirtyDays]: "Delete after 30 days",
|
|
1078
1136
|
[GovIdRetentionPolicy.UntilIdExpires]: "Keep until ID expires",
|
|
1079
1137
|
[GovIdRetentionPolicy.Indefinite]: "Keep on file (indefinite)",
|
|
@@ -1190,135 +1248,326 @@ export type BashEventTypeToStringType = {
|
|
|
1190
1248
|
};
|
|
1191
1249
|
export const BashEventTypeToString: BashEventTypeToStringType = {
|
|
1192
1250
|
[BashEventType.AfterParty]: "After-Party",
|
|
1193
|
-
[BashEventType.AnimeAndCosplayFestival]: "Anime and Cosplay Festival",
|
|
1194
1251
|
[BashEventType.AnniversaryCelebration]: "Anniversary Celebration",
|
|
1252
|
+
[BashEventType.ArtAndCraftNight]: "Art and Craft Night",
|
|
1195
1253
|
[BashEventType.ArtExhibitOpening]: "Art Exhibit Opening",
|
|
1196
|
-
[BashEventType.
|
|
1254
|
+
[BashEventType.BBQCookout]: "BBQ Cookout",
|
|
1255
|
+
[BashEventType.BabyShower]: "Baby Shower",
|
|
1256
|
+
[BashEventType.BachelorParty]: "Bachelor Party",
|
|
1257
|
+
[BashEventType.BacheloretteParty]: "Bachelorette Party",
|
|
1197
1258
|
[BashEventType.BeachParty]: "Beach Party",
|
|
1198
|
-
[BashEventType.
|
|
1259
|
+
[BashEventType.Birthday]: "Birthday",
|
|
1260
|
+
[BashEventType.BoatParty]: "Boat Party",
|
|
1261
|
+
[BashEventType.Bonfire]: "Bonfire",
|
|
1262
|
+
[BashEventType.BridalShower]: "Bridal Shower",
|
|
1263
|
+
[BashEventType.BrunchGathering]: "Brunch Gathering",
|
|
1199
1264
|
[BashEventType.CarShow]: "Car Show",
|
|
1200
|
-
[BashEventType.
|
|
1265
|
+
[BashEventType.Carnival]: "Carnival",
|
|
1201
1266
|
[BashEventType.CasinoNight]: "Casino Night",
|
|
1202
1267
|
[BashEventType.CasualMixer]: "Casual Mixer",
|
|
1203
|
-
[BashEventType.ChristmasParty]: "Christmas Party",
|
|
1204
1268
|
[BashEventType.CharityGala]: "Charity Gala",
|
|
1205
|
-
[BashEventType.
|
|
1206
|
-
[BashEventType.
|
|
1207
|
-
|
|
1208
|
-
[BashEventType.
|
|
1209
|
-
|
|
1210
|
-
[BashEventType.
|
|
1211
|
-
[BashEventType.CommunityMovieNight]: "Community Movie Night",
|
|
1212
|
-
[BashEventType.Competition]: "Competition",
|
|
1269
|
+
[BashEventType.ChristmasParty]: "Christmas Party",
|
|
1270
|
+
[BashEventType.ChurchEvent]: "Church Event",
|
|
1271
|
+
[BashEventType.CitySponsored]: "City-Sponsored Event",
|
|
1272
|
+
[BashEventType.CocktailParty]: "Cocktail Party",
|
|
1273
|
+
[BashEventType.CollegeParty]: "College Party",
|
|
1274
|
+
[BashEventType.ComedyShow]: "Comedy Show",
|
|
1213
1275
|
[BashEventType.Concert]: "Concert",
|
|
1214
|
-
[BashEventType.
|
|
1215
|
-
[BashEventType.
|
|
1216
|
-
[BashEventType.
|
|
1276
|
+
[BashEventType.Conference]: "Conference",
|
|
1277
|
+
[BashEventType.Convention]: "Convention",
|
|
1278
|
+
[BashEventType.CorporateEvent]: "Corporate Event",
|
|
1279
|
+
[BashEventType.Cruise]: "Cruise",
|
|
1217
1280
|
[BashEventType.DanceParty]: "Dance Party",
|
|
1218
|
-
[BashEventType.
|
|
1219
|
-
[BashEventType.
|
|
1281
|
+
[BashEventType.DiscoNight]: "Disco Night",
|
|
1282
|
+
[BashEventType.EasterGathering]: "Easter Gathering",
|
|
1283
|
+
[BashEventType.EngagementParty]: "Engagement Party",
|
|
1284
|
+
[BashEventType.Fair]: "Fair",
|
|
1285
|
+
[BashEventType.FarewellParty]: "Farewell Party",
|
|
1220
1286
|
[BashEventType.FashionShow]: "Fashion Show",
|
|
1221
1287
|
[BashEventType.Festival]: "Festival",
|
|
1222
1288
|
[BashEventType.FestivalFilm]: "Film Festival",
|
|
1223
1289
|
[BashEventType.FestivalFood]: "Food Festival",
|
|
1224
1290
|
[BashEventType.Fundraiser]: "Fundraiser",
|
|
1291
|
+
[BashEventType.GameNight]: "Game Night",
|
|
1292
|
+
[BashEventType.GamingEvent]: "Gaming Event",
|
|
1293
|
+
[BashEventType.GardenParty]: "Garden Party",
|
|
1294
|
+
[BashEventType.GraduationParty]: "Graduation Party",
|
|
1225
1295
|
[BashEventType.HalloweenParty]: "Halloween Party",
|
|
1296
|
+
[BashEventType.HanukkahParty]: "Hanukkah Party",
|
|
1226
1297
|
[BashEventType.HolidayParty]: "Holiday Party",
|
|
1227
1298
|
[BashEventType.HouseParty]: "House Party",
|
|
1299
|
+
[BashEventType.HousewarmingParty]: "Housewarming Party",
|
|
1228
1300
|
[BashEventType.KaraokeNight]: "Karaoke Night",
|
|
1301
|
+
[BashEventType.LaunchParty]: "Launch Party",
|
|
1302
|
+
[BashEventType.LuxuryRetreat]: "Luxury Retreat",
|
|
1229
1303
|
[BashEventType.MansionParty]: "Mansion Party",
|
|
1230
1304
|
[BashEventType.MardiGras]: "Mardi Gras",
|
|
1231
|
-
[BashEventType.
|
|
1232
|
-
[BashEventType.
|
|
1305
|
+
[BashEventType.Memorial]: "Memorial",
|
|
1306
|
+
[BashEventType.MovieNight]: "Movie Night",
|
|
1233
1307
|
[BashEventType.MoviePremiere]: "Movie Premiere",
|
|
1234
1308
|
[BashEventType.MusicFestival]: "Music Festival",
|
|
1235
1309
|
[BashEventType.NewYearsEveCelebration]: "New Year's Eve Celebration",
|
|
1310
|
+
[BashEventType.OfficeParty]: "Office Party",
|
|
1236
1311
|
[BashEventType.OpenMicNight]: "Open Mic Night",
|
|
1237
|
-
[BashEventType.
|
|
1312
|
+
[BashEventType.OutdoorActivity]: "Outdoor Activity",
|
|
1238
1313
|
[BashEventType.Parade]: "Parade",
|
|
1239
|
-
[BashEventType.
|
|
1314
|
+
[BashEventType.Party]: "Party",
|
|
1240
1315
|
[BashEventType.PoolParty]: "Pool Party",
|
|
1241
|
-
[BashEventType.
|
|
1316
|
+
[BashEventType.Potluck]: "Potluck",
|
|
1317
|
+
[BashEventType.PreParty]: "Pre-Party",
|
|
1242
1318
|
[BashEventType.ProfessionalNetworkingEvent]: "Professional Networking Event",
|
|
1243
|
-
[BashEventType.Rave]: "Rave (EDM)",
|
|
1244
|
-
[BashEventType.Reunion]: "Reunion",
|
|
1245
|
-
[BashEventType.SchoolEvent]: "School Event",
|
|
1246
|
-
[BashEventType.UniversityEvent]: "University Event",
|
|
1247
|
-
[BashEventType.SportsTournament]: "Sports Tournament",
|
|
1248
1319
|
[BashEventType.PubCrawl]: "Pub Crawl",
|
|
1249
|
-
[BashEventType.
|
|
1250
|
-
[BashEventType.TradeShow]: "Trade Show",
|
|
1251
|
-
[BashEventType.ValentinesDayParty]: "Valentine's Day Party",
|
|
1252
|
-
[BashEventType.WeddingReception]: "Wedding Reception",
|
|
1253
|
-
[BashEventType.WellnessFestival]: "Wellness Festival",
|
|
1254
|
-
[BashEventType.WineTastingEvent]: "Wine Tasting Event",
|
|
1255
|
-
[BashEventType.Other]: "Other",
|
|
1256
|
-
[BashEventType.ExclusiveLuxuryRetreat]: "Exclusive Luxury Retreat",
|
|
1257
|
-
[BashEventType.LaunchParty]: "Launch Party",
|
|
1258
|
-
[BashEventType.ArtAndCraftNight]: "Art and Craft Night",
|
|
1259
|
-
[BashEventType.BBQCookout]: "BBQ Cookout",
|
|
1260
|
-
[BashEventType.BabyShower]: "Baby Shower",
|
|
1261
|
-
[BashEventType.Birthday]: "Birthday",
|
|
1262
|
-
[BashEventType.Bonfire]: "Bonfire",
|
|
1263
|
-
[BashEventType.BookClubMeeting]: "Book Club Meeting",
|
|
1264
|
-
[BashEventType.BridalShower]: "Bridal Shower",
|
|
1265
|
-
[BashEventType.BrunchGathering]: "Brunch Gathering",
|
|
1266
|
-
[BashEventType.CharityFundraiser]: "Charity Fundraiser",
|
|
1267
|
-
[BashEventType.ChurchEvent]: "Church Event",
|
|
1268
|
-
[BashEventType.CocktailParty]: "Cocktail Party",
|
|
1269
|
-
[BashEventType.CostumeParty_Theme_Based]: "Theme-Based Costume Party",
|
|
1270
|
-
[BashEventType.DesertRave]: "Desert Rave",
|
|
1271
|
-
[BashEventType.DiscoNight]: "Disco Night",
|
|
1272
|
-
[BashEventType.EasterGathering]: "Easter Gathering",
|
|
1273
|
-
[BashEventType.EngagementParty]: "Engagement Party",
|
|
1274
|
-
[BashEventType.FantasyThemedParty]: "Fantasy Themed Party",
|
|
1275
|
-
[BashEventType.Fireside]: "Fireside",
|
|
1276
|
-
[BashEventType.FitnessFestival]: "Fitness Festival",
|
|
1277
|
-
[BashEventType.FlashMob]: "Flash Mob",
|
|
1278
|
-
[BashEventType.FundraisingEvent]: "Fundraising Event",
|
|
1279
|
-
[BashEventType.GalaDinner]: "Gala Dinner",
|
|
1280
|
-
[BashEventType.GameNight]: "Game Night",
|
|
1281
|
-
[BashEventType.GamingEvent]: "Gaming Event",
|
|
1282
|
-
[BashEventType.GardenParty]: "Garden Party",
|
|
1283
|
-
[BashEventType.GoingAwayPartyOrFarewell]: "Going Away Party/Farewell",
|
|
1284
|
-
[BashEventType.GraduationParty]: "Graduation Party",
|
|
1285
|
-
[BashEventType.HanukkahParty]: "Hanukkah Party",
|
|
1286
|
-
[BashEventType.HistoricalEraParty]: "Historical Era Party",
|
|
1287
|
-
[BashEventType.HousewarmingParty]: "Housewarming Party",
|
|
1288
|
-
[BashEventType.KiteFlyingFestival]: "Kite Flying Festival",
|
|
1289
|
-
[BashEventType.LiveBandPerformanceInALocalVenue]:
|
|
1290
|
-
"Live Band Performance in a Local Venue",
|
|
1291
|
-
[BashEventType.Luau]: "Luau",
|
|
1292
|
-
[BashEventType.MotorcycleRally]: "Motorcycle Rally",
|
|
1293
|
-
[BashEventType.MovieNight]: "Movie Night",
|
|
1294
|
-
[BashEventType.OutdoorActivity]: "Outdoor Activity",
|
|
1295
|
-
[BashEventType.OutdoorMovieNight_WithAProjector]:
|
|
1296
|
-
"Outdoor Movie Night (With Projector)",
|
|
1297
|
-
[BashEventType.Party]: "Party",
|
|
1298
|
-
[BashEventType.PotluckVegan]: "Vegan Potluck",
|
|
1299
|
-
[BashEventType.PreParty]: "Pre-Party",
|
|
1300
|
-
[BashEventType.Rave_General]: "Rave (General)",
|
|
1320
|
+
[BashEventType.Rave]: "Rave",
|
|
1301
1321
|
[BashEventType.RetirementCelebration]: "Retirement Celebration",
|
|
1302
|
-
[BashEventType.
|
|
1303
|
-
|
|
1304
|
-
[BashEventType.SafariAdventureParty]: "Safari Adventure Party",
|
|
1305
|
-
[BashEventType.SchoolEvent_MiddleSchoolOrHighSchoolOrCollege]:
|
|
1306
|
-
"School Event (Middle School/High School/College)",
|
|
1307
|
-
[BashEventType.ScienceFictionThemedParty]: "Science Fiction Themed Party",
|
|
1322
|
+
[BashEventType.Reunion]: "Reunion",
|
|
1323
|
+
[BashEventType.SchoolEvent]: "School Event",
|
|
1308
1324
|
[BashEventType.SocialClubEvent]: "Social Club Event",
|
|
1309
1325
|
[BashEventType.SportsWatchParty]: "Sports Watch Party",
|
|
1310
|
-
[BashEventType.SuperheroThemedParty]: "Superhero Themed Party",
|
|
1311
1326
|
[BashEventType.ThanksgivingDinner]: "Thanksgiving Dinner",
|
|
1312
|
-
[BashEventType.ThemedCostumeParty]: "Themed Costume Party",
|
|
1313
1327
|
[BashEventType.ThemedDinnerParty]: "Themed Dinner Party",
|
|
1328
|
+
[BashEventType.ThemedParty]: "Themed Party",
|
|
1314
1329
|
[BashEventType.ThemedPubCrawl]: "Themed Pub Crawl",
|
|
1315
|
-
[BashEventType.
|
|
1330
|
+
[BashEventType.Tournament]: "Tournament",
|
|
1331
|
+
[BashEventType.TradeShow]: "Trade Show",
|
|
1316
1332
|
[BashEventType.TriviaNight]: "Trivia Night",
|
|
1333
|
+
[BashEventType.ValentinesDayParty]: "Valentine's Day Party",
|
|
1334
|
+
[BashEventType.WeddingReception]: "Wedding Reception",
|
|
1317
1335
|
[BashEventType.WelcomeHomeParty]: "Welcome Home Party",
|
|
1318
|
-
[BashEventType.
|
|
1319
|
-
[BashEventType.
|
|
1320
|
-
[BashEventType.
|
|
1336
|
+
[BashEventType.WineTastingEvent]: "Wine Tasting Event",
|
|
1337
|
+
[BashEventType.Workshop]: "Workshop",
|
|
1338
|
+
[BashEventType.Other]: "Other",
|
|
1339
|
+
};
|
|
1340
|
+
|
|
1341
|
+
/**
|
|
1342
|
+
* Positive-framed dietary accommodations a host can advertise on a bash and
|
|
1343
|
+
* guests can filter by on the homepage. Labels are intentionally upbeat —
|
|
1344
|
+
* "options available" rather than "free of" — and stay short enough for tag
|
|
1345
|
+
* chips. See `DietaryOption` in `prisma/schema.prisma` for the canonical list.
|
|
1346
|
+
*/
|
|
1347
|
+
export type DietaryOptionToStringType = {
|
|
1348
|
+
[key in DietaryOption]: string;
|
|
1321
1349
|
};
|
|
1350
|
+
export const DietaryOptionToString: DietaryOptionToStringType = {
|
|
1351
|
+
[DietaryOption.GlutenFreeOptions]: "Gluten-Free Options Available",
|
|
1352
|
+
[DietaryOption.VeganOptions]: "Vegan Options Available",
|
|
1353
|
+
[DietaryOption.VegetarianOptions]: "Vegetarian Options Available",
|
|
1354
|
+
[DietaryOption.DairyFreeOptions]: "Dairy-Free Options Available",
|
|
1355
|
+
[DietaryOption.NutFreeOptions]: "Nut-Free Options Available",
|
|
1356
|
+
[DietaryOption.HalalOptions]: "Halal Options Available",
|
|
1357
|
+
[DietaryOption.KosherOptions]: "Kosher Options Available",
|
|
1358
|
+
[DietaryOption.SugarFreeOptions]: "Low-Sugar / Sugar-Free Options Available",
|
|
1359
|
+
[DietaryOption.KetoOptions]: "Keto-Friendly Options Available",
|
|
1360
|
+
[DietaryOption.PaleoOptions]: "Paleo-Friendly Options Available",
|
|
1361
|
+
[DietaryOption.AlcoholFreeOptions]: "Non-Alcoholic Options Available",
|
|
1362
|
+
};
|
|
1363
|
+
|
|
1364
|
+
/** Short chip labels used in tight UI spots (filter modal, card pills). */
|
|
1365
|
+
export const DietaryOptionShortLabel: DietaryOptionToStringType = {
|
|
1366
|
+
[DietaryOption.GlutenFreeOptions]: "Gluten-Free",
|
|
1367
|
+
[DietaryOption.VeganOptions]: "Vegan",
|
|
1368
|
+
[DietaryOption.VegetarianOptions]: "Vegetarian",
|
|
1369
|
+
[DietaryOption.DairyFreeOptions]: "Dairy-Free",
|
|
1370
|
+
[DietaryOption.NutFreeOptions]: "Nut-Free",
|
|
1371
|
+
[DietaryOption.HalalOptions]: "Halal",
|
|
1372
|
+
[DietaryOption.KosherOptions]: "Kosher",
|
|
1373
|
+
[DietaryOption.SugarFreeOptions]: "Sugar-Free",
|
|
1374
|
+
[DietaryOption.KetoOptions]: "Keto",
|
|
1375
|
+
[DietaryOption.PaleoOptions]: "Paleo",
|
|
1376
|
+
[DietaryOption.AlcoholFreeOptions]: "Non-Alcoholic",
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1379
|
+
/** All `DietaryOption` enum values in display order (for rendering checkboxes/tags). */
|
|
1380
|
+
export const DIETARY_OPTION_VALUES: ReadonlyArray<DietaryOption> = [
|
|
1381
|
+
DietaryOption.GlutenFreeOptions,
|
|
1382
|
+
DietaryOption.VeganOptions,
|
|
1383
|
+
DietaryOption.VegetarianOptions,
|
|
1384
|
+
DietaryOption.DairyFreeOptions,
|
|
1385
|
+
DietaryOption.NutFreeOptions,
|
|
1386
|
+
DietaryOption.HalalOptions,
|
|
1387
|
+
DietaryOption.KosherOptions,
|
|
1388
|
+
DietaryOption.SugarFreeOptions,
|
|
1389
|
+
DietaryOption.KetoOptions,
|
|
1390
|
+
DietaryOption.PaleoOptions,
|
|
1391
|
+
DietaryOption.AlcoholFreeOptions,
|
|
1392
|
+
];
|
|
1393
|
+
|
|
1394
|
+
/** Display labels for `IncomeRange` (wizard primary/secondary chips). */
|
|
1395
|
+
export type IncomeRangeToStringType = {
|
|
1396
|
+
[key in IncomeRange]: string;
|
|
1397
|
+
};
|
|
1398
|
+
export const IncomeRangeLabel: IncomeRangeToStringType = {
|
|
1399
|
+
[IncomeRange.NoPreference]: "Anyone",
|
|
1400
|
+
[IncomeRange.Under40k]: "Under $40k",
|
|
1401
|
+
[IncomeRange.From40to80k]: "$40k – $80k",
|
|
1402
|
+
[IncomeRange.From80to150k]: "$80k – $150k",
|
|
1403
|
+
[IncomeRange.From150to200k]: "$150k – $200k",
|
|
1404
|
+
[IncomeRange.From200to500k]:
|
|
1405
|
+
"$200k – $500k (common accredited-income band)",
|
|
1406
|
+
[IncomeRange.From500kTo1M]: "$500k – $1M",
|
|
1407
|
+
[IncomeRange.Over1M]: "$1M+",
|
|
1408
|
+
[IncomeRange.PreferNotToSay]: "Prefer not to say",
|
|
1409
|
+
};
|
|
1410
|
+
|
|
1411
|
+
/** Short labels for filter modal / tight chips. */
|
|
1412
|
+
export const IncomeRangeShortLabel: IncomeRangeToStringType = {
|
|
1413
|
+
[IncomeRange.NoPreference]: "Any income",
|
|
1414
|
+
[IncomeRange.Under40k]: "<$40k",
|
|
1415
|
+
[IncomeRange.From40to80k]: "$40–80k",
|
|
1416
|
+
[IncomeRange.From80to150k]: "$80–150k",
|
|
1417
|
+
[IncomeRange.From150to200k]: "$150–200k",
|
|
1418
|
+
[IncomeRange.From200to500k]: "$200–500k",
|
|
1419
|
+
[IncomeRange.From500kTo1M]: "$500k–$1M",
|
|
1420
|
+
[IncomeRange.Over1M]: "$1M+",
|
|
1421
|
+
[IncomeRange.PreferNotToSay]: "No answer",
|
|
1422
|
+
};
|
|
1423
|
+
|
|
1424
|
+
/**
|
|
1425
|
+
* All `IncomeRange` values in display order (checkboxes, tags).
|
|
1426
|
+
* Audience-targeting only — never use to gate ticket purchase or entry.
|
|
1427
|
+
*/
|
|
1428
|
+
export const INCOME_RANGE_VALUES: ReadonlyArray<IncomeRange> = [
|
|
1429
|
+
IncomeRange.Under40k,
|
|
1430
|
+
IncomeRange.From40to80k,
|
|
1431
|
+
IncomeRange.From80to150k,
|
|
1432
|
+
IncomeRange.From150to200k,
|
|
1433
|
+
IncomeRange.From200to500k,
|
|
1434
|
+
IncomeRange.From500kTo1M,
|
|
1435
|
+
IncomeRange.Over1M,
|
|
1436
|
+
IncomeRange.PreferNotToSay,
|
|
1437
|
+
IncomeRange.NoPreference,
|
|
1438
|
+
];
|
|
1439
|
+
|
|
1440
|
+
/** Homepage / discovery section labels for synthetic rows (not `BashEventType` enum values). */
|
|
1441
|
+
const SYNTHETIC_BASH_SECTION_TITLE: Record<string, string> = {
|
|
1442
|
+
Featured: "Featured bashes",
|
|
1443
|
+
Trending: "Trending bashes",
|
|
1444
|
+
};
|
|
1445
|
+
|
|
1446
|
+
/**
|
|
1447
|
+
* Manual plural headings for singular labels that suffix rules would get wrong.
|
|
1448
|
+
* Keys must match `BashEventTypeToString` values exactly.
|
|
1449
|
+
*/
|
|
1450
|
+
const BASH_EVENT_SINGULAR_LABEL_TO_PLURAL_SECTION: ReadonlyMap<string, string> =
|
|
1451
|
+
new Map([
|
|
1452
|
+
["Other", "Other"],
|
|
1453
|
+
["Birthday", "Birthday Parties"],
|
|
1454
|
+
["School Event", "School Events"],
|
|
1455
|
+
["City-Sponsored Event", "City-Sponsored Events"],
|
|
1456
|
+
["Mardi Gras", "Mardi Gras"],
|
|
1457
|
+
]);
|
|
1458
|
+
|
|
1459
|
+
function insertSpacesInCamelCase(str: string): string {
|
|
1460
|
+
return str.replace(/([a-z])([A-Z])/g, "$1 $2");
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
/** Single-token titles from `BashEventTypeToString` that need explicit plurals. */
|
|
1464
|
+
const WHOLE_WORD_BASH_LABEL_PLURAL: ReadonlyMap<string, string> = new Map([
|
|
1465
|
+
["Tournament", "Tournaments"],
|
|
1466
|
+
["Festival", "Festivals"],
|
|
1467
|
+
["Concert", "Concerts"],
|
|
1468
|
+
["Conference", "Conferences"],
|
|
1469
|
+
["Convention", "Conventions"],
|
|
1470
|
+
["Parade", "Parades"],
|
|
1471
|
+
["Fundraiser", "Fundraisers"],
|
|
1472
|
+
["Reunion", "Reunions"],
|
|
1473
|
+
["Potluck", "Potlucks"],
|
|
1474
|
+
["Bonfire", "Bonfires"],
|
|
1475
|
+
["Memorial", "Memorials"],
|
|
1476
|
+
["Workshop", "Workshops"],
|
|
1477
|
+
["Rave", "Raves"],
|
|
1478
|
+
["Carnival", "Carnivals"],
|
|
1479
|
+
["Fair", "Fairs"],
|
|
1480
|
+
["Cruise", "Cruises"],
|
|
1481
|
+
]);
|
|
1482
|
+
|
|
1483
|
+
function pluralizeBashEventSingularLabel(label: string): string {
|
|
1484
|
+
const manual = BASH_EVENT_SINGULAR_LABEL_TO_PLURAL_SECTION.get(label);
|
|
1485
|
+
if (manual) return manual;
|
|
1486
|
+
|
|
1487
|
+
const wholeWord = WHOLE_WORD_BASH_LABEL_PLURAL.get(label);
|
|
1488
|
+
if (wholeWord) return wholeWord;
|
|
1489
|
+
|
|
1490
|
+
if (label === "Party") return "Parties";
|
|
1491
|
+
if (label.endsWith(" Party")) {
|
|
1492
|
+
return `${label.slice(0, -" Party".length)} Parties`;
|
|
1493
|
+
}
|
|
1494
|
+
if (label.endsWith("-Party")) {
|
|
1495
|
+
return `${label.slice(0, -"-Party".length)}-Parties`;
|
|
1496
|
+
}
|
|
1497
|
+
if (label.endsWith(" Party)")) {
|
|
1498
|
+
return `${label.replace(/ Party\)$/, " Parties)")}`;
|
|
1499
|
+
}
|
|
1500
|
+
if (label.endsWith(" Rave")) {
|
|
1501
|
+
return `${label.slice(0, -" Rave".length)} Raves`;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
const replacements: ReadonlyArray<[suffix: string, plural: string]> = [
|
|
1505
|
+
[" Competition", " Competitions"],
|
|
1506
|
+
[" Tournament", " Tournaments"],
|
|
1507
|
+
[" Festival", " Festivals"],
|
|
1508
|
+
[" Gathering", " Gatherings"],
|
|
1509
|
+
[" Celebration", " Celebrations"],
|
|
1510
|
+
[" Convention", " Conventions"],
|
|
1511
|
+
[" Fundraiser", " Fundraisers"],
|
|
1512
|
+
[" Reception", " Receptions"],
|
|
1513
|
+
[" Mixer", " Mixers"],
|
|
1514
|
+
[" Crawl", " Crawls"],
|
|
1515
|
+
[" Rally", " Rallies"],
|
|
1516
|
+
[" Premiere", " Premieres"],
|
|
1517
|
+
[" Retreat", " Retreats"],
|
|
1518
|
+
[" Activity", " Activities"],
|
|
1519
|
+
[" Meeting", " Meetings"],
|
|
1520
|
+
[" Shower", " Showers"],
|
|
1521
|
+
[" Opening", " Openings"],
|
|
1522
|
+
[" Cookout", " Cookouts"],
|
|
1523
|
+
[" Potluck", " Potlucks"],
|
|
1524
|
+
[" Launch", " Launches"],
|
|
1525
|
+
[" Dinner", " Dinners"],
|
|
1526
|
+
[" Ball", " Balls"],
|
|
1527
|
+
[" Gala", " Galas"],
|
|
1528
|
+
[" Fair", " Fairs"],
|
|
1529
|
+
[" Parade", " Parades"],
|
|
1530
|
+
[" Concert", " Concerts"],
|
|
1531
|
+
[" Event", " Events"],
|
|
1532
|
+
[" Show", " Shows"],
|
|
1533
|
+
[" Night", " Nights"],
|
|
1534
|
+
[" Mob", " Mobs"],
|
|
1535
|
+
];
|
|
1536
|
+
|
|
1537
|
+
for (const [suffix, plural] of replacements) {
|
|
1538
|
+
if (label.endsWith(suffix)) {
|
|
1539
|
+
return `${label.slice(0, -suffix.length)}${plural}`;
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
return `${label} bashes`;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
const BASH_EVENT_TYPE_ENUM_VALUES: ReadonlySet<string> = new Set(
|
|
1547
|
+
Object.values(BashEventType) as string[]
|
|
1548
|
+
);
|
|
1549
|
+
|
|
1550
|
+
/**
|
|
1551
|
+
* Heading shown on the home page row and the `/category/...` page for a bash
|
|
1552
|
+
* `eventType` / section key. Uses plural-friendly copy for Prisma
|
|
1553
|
+
* `BashEventType` values; keeps synthetic rows and membership tier rows clear.
|
|
1554
|
+
*/
|
|
1555
|
+
export function bashSectionTitleForBashType(bashType: string): string {
|
|
1556
|
+
const synthetic = SYNTHETIC_BASH_SECTION_TITLE[bashType];
|
|
1557
|
+
if (synthetic != null) return synthetic;
|
|
1558
|
+
|
|
1559
|
+
if (/\bEvents$/i.test(bashType)) {
|
|
1560
|
+
return bashType;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
if (BASH_EVENT_TYPE_ENUM_VALUES.has(bashType)) {
|
|
1564
|
+
const singular = BashEventTypeToString[bashType as BashEventType];
|
|
1565
|
+
return pluralizeBashEventSingularLabel(singular);
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
const spaced = insertSpacesInCamelCase(bashType);
|
|
1569
|
+
return pluralizeBashEventSingularLabel(spaced);
|
|
1570
|
+
}
|
|
1322
1571
|
|
|
1323
1572
|
export type RecordKey = string | number | symbol;
|
|
1324
1573
|
export type PartialExcept<T, K extends keyof T> = Partial<T> & {
|
package/src/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ export * from "./mirroredPrismaEnums.js";
|
|
|
15
15
|
// Re-export ALL Prisma enums as values (usable as runtime constants, e.g. ServiceTypes.Entertainment)
|
|
16
16
|
// Excludes enums already re-exported by definitions.ts, mirroredPrismaEnums.ts, and membershipDefinitions.ts:
|
|
17
17
|
// mirroredPrismaEnums.ts: ServiceCancellationPolicy
|
|
18
|
-
// definitions.ts: YearsOfExperience, EntertainmentServiceType, MusicGenreType, ServiceTypes,
|
|
18
|
+
// definitions.ts: YearsOfExperience, GovIdRetentionPolicy, EntertainmentServiceType, MusicGenreType, ServiceTypes,
|
|
19
19
|
// membershipDefinitions.ts: MembershipTier, ReferralTier, CreditTransactionType
|
|
20
20
|
export {
|
|
21
21
|
$Enums,
|
|
@@ -108,6 +108,7 @@ export {
|
|
|
108
108
|
GuestRegistrationFormat,
|
|
109
109
|
GuestShuttleFormat,
|
|
110
110
|
InfluencerFormat,
|
|
111
|
+
IncomeRange,
|
|
111
112
|
InteriorDesignerFormat,
|
|
112
113
|
InvestmentType,
|
|
113
114
|
InvestorFormat,
|