@bash-app/bash-common 30.309.0 → 30.314.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/__tests__/competitionValidation.test.d.ts +2 -0
- package/dist/__tests__/competitionValidation.test.d.ts.map +1 -0
- package/dist/__tests__/competitionValidation.test.js +28 -0
- package/dist/__tests__/competitionValidation.test.js.map +1 -0
- package/dist/__tests__/definitionsHelpers.test.js +8 -1
- package/dist/__tests__/definitionsHelpers.test.js.map +1 -1
- package/dist/__tests__/membershipDefinitions.test.js +5 -0
- package/dist/__tests__/membershipDefinitions.test.js.map +1 -1
- package/dist/__tests__/sideQuestIdeas.test.js +5 -1
- package/dist/__tests__/sideQuestIdeas.test.js.map +1 -1
- package/dist/__tests__/statusEnums.test.js +7 -0
- package/dist/__tests__/statusEnums.test.js.map +1 -1
- package/dist/competitionValidation.d.ts +11 -2
- package/dist/competitionValidation.d.ts.map +1 -1
- package/dist/competitionValidation.js +40 -2
- package/dist/competitionValidation.js.map +1 -1
- package/dist/definitions.d.ts +18 -1
- package/dist/definitions.d.ts.map +1 -1
- package/dist/definitions.js +28 -1
- package/dist/definitions.js.map +1 -1
- package/dist/extendedSchemas.d.ts +259 -46
- package/dist/extendedSchemas.d.ts.map +1 -1
- package/dist/extendedSchemas.js +76 -22
- package/dist/extendedSchemas.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/membershipDefinitions.d.ts +2 -0
- package/dist/membershipDefinitions.d.ts.map +1 -1
- package/dist/membershipDefinitions.js +3 -0
- package/dist/membershipDefinitions.js.map +1 -1
- package/dist/mirroredPrismaEnums.d.ts +10 -0
- package/dist/mirroredPrismaEnums.d.ts.map +1 -1
- package/dist/mirroredPrismaEnums.js +16 -0
- package/dist/mirroredPrismaEnums.js.map +1 -1
- package/dist/serviceTypeLabels.d.ts +15 -0
- package/dist/serviceTypeLabels.d.ts.map +1 -0
- package/dist/serviceTypeLabels.js +24 -0
- package/dist/serviceTypeLabels.js.map +1 -0
- package/dist/sideQuestIdeas.d.ts.map +1 -1
- package/dist/sideQuestIdeas.js +2 -2
- package/dist/sideQuestIdeas.js.map +1 -1
- package/dist/sideQuestTypes.d.ts +1 -0
- package/dist/sideQuestTypes.d.ts.map +1 -1
- package/dist/sideQuestTypes.js.map +1 -1
- package/dist/targetAudienceLabels.d.ts +12 -0
- package/dist/targetAudienceLabels.d.ts.map +1 -0
- package/dist/targetAudienceLabels.js +50 -0
- package/dist/targetAudienceLabels.js.map +1 -0
- package/dist/utils/service/serviceBookingTypes.d.ts +1 -1
- package/dist/utils/service/serviceBookingTypes.d.ts.map +1 -1
- package/package.json +1 -1
- package/prisma/schema.prisma +114 -1
- package/src/__tests__/competitionValidation.test.ts +43 -0
- package/src/__tests__/definitionsHelpers.test.ts +16 -0
- package/src/__tests__/membershipDefinitions.test.ts +18 -0
- package/src/__tests__/sideQuestIdeas.test.ts +11 -1
- package/src/__tests__/statusEnums.test.ts +7 -0
- package/src/competitionValidation.ts +56 -2
- package/src/definitions.ts +40 -1
- package/src/extendedSchemas.ts +216 -63
- package/src/index.ts +2 -0
- package/src/membershipDefinitions.ts +3 -0
- package/src/mirroredPrismaEnums.ts +20 -0
- package/src/serviceTypeLabels.ts +24 -0
- package/src/sideQuestIdeas.ts +2 -2
- package/src/sideQuestTypes.ts +1 -0
- package/src/targetAudienceLabels.ts +54 -0
- package/src/utils/service/serviceBookingTypes.ts +1 -1
package/src/extendedSchemas.ts
CHANGED
|
@@ -268,18 +268,37 @@ export const PRIVATE_USER_ACCOUNT_TO_SELECT = {
|
|
|
268
268
|
},
|
|
269
269
|
} satisfies Prisma.UserSelect;
|
|
270
270
|
|
|
271
|
-
export
|
|
271
|
+
export type SponsoredEventExt = SponsoredEvent;
|
|
272
|
+
|
|
273
|
+
/** Minimal service identity used wherever a competition prize/offer just needs to point at a listing. */
|
|
274
|
+
export const SERVICE_REF_LITE_SELECT = {
|
|
275
|
+
id: true,
|
|
276
|
+
serviceName: true,
|
|
277
|
+
coverPhoto: true,
|
|
278
|
+
} satisfies Prisma.ServiceSelect;
|
|
279
|
+
|
|
280
|
+
export type ServiceRefLite = Prisma.ServiceGetPayload<{
|
|
281
|
+
select: typeof SERVICE_REF_LITE_SELECT;
|
|
282
|
+
}>;
|
|
272
283
|
|
|
273
284
|
export interface PrizeExt extends Prize {
|
|
274
285
|
winner?: PublicUser | null;
|
|
275
286
|
contributor?: PublicUser | null;
|
|
276
|
-
sourceService?:
|
|
277
|
-
id: string;
|
|
278
|
-
serviceName: string | null;
|
|
279
|
-
coverPhoto: string | null;
|
|
280
|
-
} | null;
|
|
287
|
+
sourceService?: ServiceRefLite | null;
|
|
281
288
|
}
|
|
282
289
|
|
|
290
|
+
/** Minimal prize-slot identity used wherever a sponsor offer just needs to point at the slot it's filling. */
|
|
291
|
+
export const PRIZE_SLOT_REF_SELECT = {
|
|
292
|
+
id: true,
|
|
293
|
+
name: true,
|
|
294
|
+
placeName: true,
|
|
295
|
+
sponsorCostCents: true,
|
|
296
|
+
} satisfies Prisma.PrizeSelect;
|
|
297
|
+
|
|
298
|
+
export type PrizeSlotRef = Prisma.PrizeGetPayload<{
|
|
299
|
+
select: typeof PRIZE_SLOT_REF_SELECT;
|
|
300
|
+
}>;
|
|
301
|
+
|
|
283
302
|
export interface CompetitionPrizeOfferExt {
|
|
284
303
|
id: string;
|
|
285
304
|
competitionId: string;
|
|
@@ -296,17 +315,13 @@ export interface CompetitionPrizeOfferExt {
|
|
|
296
315
|
createdAt: Date | string;
|
|
297
316
|
respondedAt?: Date | string | null;
|
|
298
317
|
offeredBy?: PublicUser;
|
|
299
|
-
sourceService?:
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
name: string;
|
|
307
|
-
placeName: string | null;
|
|
308
|
-
sponsorCostCents: number | null;
|
|
309
|
-
} | null;
|
|
318
|
+
sourceService?: ServiceRefLite | null;
|
|
319
|
+
targetPrize?: PrizeSlotRef | null;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/** One competition participant row + resolved user; shared by CompetitionExt.participants and the host roster endpoint. */
|
|
323
|
+
export interface CompetitionParticipantExt extends CompetitionParticipant {
|
|
324
|
+
user?: PublicUser | null;
|
|
310
325
|
}
|
|
311
326
|
|
|
312
327
|
/** Competition row + relations; Override keeps new columns visible before consumers refresh Prisma. */
|
|
@@ -320,7 +335,7 @@ export type CompetitionExt = Override<
|
|
|
320
335
|
prizes: PrizeExt[];
|
|
321
336
|
}
|
|
322
337
|
> & {
|
|
323
|
-
participants?:
|
|
338
|
+
participants?: CompetitionParticipantExt[];
|
|
324
339
|
votes?: CompetitionVote[];
|
|
325
340
|
entryTicketTier?: TicketTier | null;
|
|
326
341
|
sponsor?: CompetitionSponsor[];
|
|
@@ -512,24 +527,27 @@ export type BashEventUpsertWireInput = Override<
|
|
|
512
527
|
}
|
|
513
528
|
>;
|
|
514
529
|
|
|
530
|
+
/** Minimal ticket-holder identity — narrower than PublicUser/PublicTeaserUser; used wherever a ticket
|
|
531
|
+
* relation just needs to identify who owns/holds it (not a full public profile). */
|
|
532
|
+
export const TICKET_HOLDER_USER_SELECT = {
|
|
533
|
+
id: true,
|
|
534
|
+
email: true,
|
|
535
|
+
givenName: true,
|
|
536
|
+
familyName: true,
|
|
537
|
+
} satisfies Prisma.UserSelect;
|
|
538
|
+
|
|
539
|
+
export type TicketHolderUser = Prisma.UserGetPayload<{
|
|
540
|
+
select: typeof TICKET_HOLDER_USER_SELECT;
|
|
541
|
+
}>;
|
|
542
|
+
|
|
515
543
|
export const TICKET_TIER_DATA_TO_INCLUDE = {
|
|
516
544
|
tickets: {
|
|
517
545
|
include: {
|
|
518
546
|
owner: {
|
|
519
|
-
select:
|
|
520
|
-
id: true,
|
|
521
|
-
email: true,
|
|
522
|
-
givenName: true,
|
|
523
|
-
familyName: true,
|
|
524
|
-
},
|
|
547
|
+
select: TICKET_HOLDER_USER_SELECT,
|
|
525
548
|
},
|
|
526
549
|
forUser: {
|
|
527
|
-
select:
|
|
528
|
-
id: true,
|
|
529
|
-
email: true,
|
|
530
|
-
givenName: true,
|
|
531
|
-
familyName: true,
|
|
532
|
-
},
|
|
550
|
+
select: TICKET_HOLDER_USER_SELECT,
|
|
533
551
|
},
|
|
534
552
|
},
|
|
535
553
|
},
|
|
@@ -579,7 +597,7 @@ export const BASH_EVENT_DATA_TO_INCLUDE = {
|
|
|
579
597
|
select: FRONT_END_USER_DATA_TO_SELECT,
|
|
580
598
|
},
|
|
581
599
|
sourceService: {
|
|
582
|
-
select:
|
|
600
|
+
select: SERVICE_REF_LITE_SELECT,
|
|
583
601
|
},
|
|
584
602
|
},
|
|
585
603
|
},
|
|
@@ -669,9 +687,15 @@ export const VENUE_DATA_TO_REMOVE: RemoveCommonProperties<
|
|
|
669
687
|
// 'bashEvents',
|
|
670
688
|
] as const;
|
|
671
689
|
|
|
672
|
-
|
|
690
|
+
/** Shared by Vendor/EventService/EntertainmentService/Exhibitor/Sponsor includes — each model has
|
|
691
|
+
* its own identically-shaped `crowdSize`/`serviceRange` relations (attendance preferences). */
|
|
692
|
+
export const SERVICE_SUBTYPE_CROWD_RANGE_INCLUDE = {
|
|
673
693
|
crowdSize: true,
|
|
674
694
|
serviceRange: true,
|
|
695
|
+
} as const;
|
|
696
|
+
|
|
697
|
+
export const VENDOR_DATA_TO_INCLUDE = {
|
|
698
|
+
...SERVICE_SUBTYPE_CROWD_RANGE_INCLUDE,
|
|
675
699
|
} satisfies Prisma.VendorInclude;
|
|
676
700
|
|
|
677
701
|
export const VOLUNTEER_DATA_TO_INCLUDE = {
|
|
@@ -703,24 +727,20 @@ export type VolunteerServiceExt = Prisma.VolunteerServiceGetPayload<{
|
|
|
703
727
|
export const VENUE_DATA_TO_INCLUDE = {} satisfies Prisma.VenueInclude;
|
|
704
728
|
|
|
705
729
|
export const EVENT_SERVICE_DATA_TO_INCLUDE = {
|
|
706
|
-
|
|
707
|
-
serviceRange: true,
|
|
730
|
+
...SERVICE_SUBTYPE_CROWD_RANGE_INCLUDE,
|
|
708
731
|
formatOptions: true,
|
|
709
732
|
} satisfies Prisma.EventServiceInclude;
|
|
710
733
|
|
|
711
734
|
export const ENTERTAINMENT_SERVICE_DATA_TO_INCLUDE = {
|
|
712
|
-
|
|
713
|
-
serviceRange: true,
|
|
735
|
+
...SERVICE_SUBTYPE_CROWD_RANGE_INCLUDE,
|
|
714
736
|
} satisfies Prisma.EntertainmentServiceInclude;
|
|
715
737
|
|
|
716
738
|
export const SPONSOR_DATA_TO_INCLUDE = {
|
|
717
|
-
|
|
718
|
-
serviceRange: true,
|
|
739
|
+
...SERVICE_SUBTYPE_CROWD_RANGE_INCLUDE,
|
|
719
740
|
} satisfies Prisma.SponsorInclude;
|
|
720
741
|
|
|
721
742
|
export const EXHIBITOR_DATA_TO_INCLUDE = {
|
|
722
|
-
|
|
723
|
-
serviceRange: true,
|
|
743
|
+
...SERVICE_SUBTYPE_CROWD_RANGE_INCLUDE,
|
|
724
744
|
} satisfies Prisma.ExhibitorInclude;
|
|
725
745
|
|
|
726
746
|
// Lightweight include for public service listings (browse pages).
|
|
@@ -848,6 +868,11 @@ export const SERVICE_DATA_TO_INCLUDE = {
|
|
|
848
868
|
sportsProfile: true,
|
|
849
869
|
}
|
|
850
870
|
}, // Include organization data with member counts
|
|
871
|
+
// Lightweight — just enough for the UI to know a complementary Vendor <-> EventServices
|
|
872
|
+
// profile already exists (see Part B "also list as" flow) without a second fetch.
|
|
873
|
+
complementaryProfiles: {
|
|
874
|
+
select: { id: true, serviceType: true },
|
|
875
|
+
},
|
|
851
876
|
// bookings: {
|
|
852
877
|
// include: SERVICE_BOOKING_PRIVATE_DATA_TO_INCLUDE, //make sure only to include owned bookedDays
|
|
853
878
|
// },
|
|
@@ -919,10 +944,9 @@ export interface ServiceBookingAddOnExt extends ServiceBookingAddOn {
|
|
|
919
944
|
export interface ServiceBookingPackageExt extends ServiceBookingPackage {
|
|
920
945
|
package: ServicePackageExt;
|
|
921
946
|
}
|
|
922
|
-
export
|
|
923
|
-
extends ServiceBookingPriceBreakdown {}
|
|
947
|
+
export type ServiceBookingPriceBreakdownExt = ServiceBookingPriceBreakdown;
|
|
924
948
|
|
|
925
|
-
export
|
|
949
|
+
export type ServiceBookingFeeExt = ServiceBookingFee;
|
|
926
950
|
export interface ServiceBookingDayExt extends ServiceBookingDay {
|
|
927
951
|
addOns: ServiceBookingAddOnExt[];
|
|
928
952
|
packages: ServiceBookingPackageExt[];
|
|
@@ -1101,6 +1125,9 @@ export interface ServiceExt extends Service {
|
|
|
1101
1125
|
associatedBashesReferencingMe?: AssociatedBashExt[];
|
|
1102
1126
|
associatedServicesReferencingMe?: AssociatedServiceExt[];
|
|
1103
1127
|
|
|
1128
|
+
/** Reverse side of `complementaryOfServiceId` — the "also list as" profile(s) this service already spawned. */
|
|
1129
|
+
complementaryProfiles?: Pick<Service, "id" | "serviceType">[];
|
|
1130
|
+
|
|
1104
1131
|
// googleReviews: GoogleReview[];
|
|
1105
1132
|
|
|
1106
1133
|
// For availability filtering - matches Prisma relation name "bookings"
|
|
@@ -1157,32 +1184,28 @@ export type ServiceExtNoIds = Omit<
|
|
|
1157
1184
|
| "serviceRatesAssociationId"
|
|
1158
1185
|
| "serviceId"
|
|
1159
1186
|
>;
|
|
1160
|
-
|
|
1187
|
+
/** Attendance-preference overlay shared by every bookable service subtype — mirrors
|
|
1188
|
+
* SERVICE_SUBTYPE_CROWD_RANGE_INCLUDE so the type and the select/include it's derived from stay in sync. */
|
|
1189
|
+
export interface ServiceSubtypeCrowdRange {
|
|
1161
1190
|
crowdSize?: AmountOfGuests;
|
|
1162
1191
|
serviceRange?: ServiceRange;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
export interface EventServiceExt extends EventService, ServiceSubtypeCrowdRange {
|
|
1163
1195
|
formatOptions?: ServiceFormatOption[];
|
|
1164
1196
|
}
|
|
1165
1197
|
|
|
1166
1198
|
export interface EntertainmentServiceExt
|
|
1167
|
-
extends Omit<EntertainmentService, "notableVenueEntries"
|
|
1168
|
-
|
|
1169
|
-
serviceRange?: ServiceRange;
|
|
1199
|
+
extends Omit<EntertainmentService, "notableVenueEntries">,
|
|
1200
|
+
ServiceSubtypeCrowdRange {
|
|
1170
1201
|
notableVenueEntries?: EntertainmentNotableVenueEntry[];
|
|
1171
1202
|
}
|
|
1172
1203
|
|
|
1173
|
-
export interface ExhibitorExt extends Exhibitor {
|
|
1174
|
-
crowdSize?: AmountOfGuests;
|
|
1175
|
-
serviceRange?: ServiceRange;
|
|
1176
|
-
}
|
|
1204
|
+
export interface ExhibitorExt extends Exhibitor, ServiceSubtypeCrowdRange {}
|
|
1177
1205
|
|
|
1178
|
-
export interface SponsorExt extends Sponsor {
|
|
1179
|
-
crowdSize?: AmountOfGuests;
|
|
1180
|
-
serviceRange?: ServiceRange;
|
|
1181
|
-
}
|
|
1206
|
+
export interface SponsorExt extends Sponsor, ServiceSubtypeCrowdRange {}
|
|
1182
1207
|
|
|
1183
|
-
export interface VendorExt extends Vendor {
|
|
1184
|
-
crowdSize?: AmountOfGuests;
|
|
1185
|
-
serviceRange?: ServiceRange;
|
|
1208
|
+
export interface VendorExt extends Vendor, ServiceSubtypeCrowdRange {
|
|
1186
1209
|
spaceRequirements?: VendorSpaceRequirements;
|
|
1187
1210
|
insurance?: VendorInsurance;
|
|
1188
1211
|
permits?: VendorPermit[];
|
|
@@ -1191,6 +1214,108 @@ export interface VendorExt extends Vendor {
|
|
|
1191
1214
|
};
|
|
1192
1215
|
}
|
|
1193
1216
|
|
|
1217
|
+
//-------------------------------------------------------------------------------------------------------------------------------
|
|
1218
|
+
// Partner (Vendor/Exhibitor/Sponsor) booking requests
|
|
1219
|
+
//
|
|
1220
|
+
// VendorBookingRequest/ExhibitorBookingRequest/SponsorBookingRequest are three separate Prisma
|
|
1221
|
+
// models (a real merge into one polymorphic table is a future schema migration — see the
|
|
1222
|
+
// bash-common schema/type consolidation plan). Until then, these GetPayload-derived types give
|
|
1223
|
+
// the API and app a single shared, real contract instead of hand-typed hand-drift per package.
|
|
1224
|
+
//-------------------------------------------------------------------------------------------------------------------------------
|
|
1225
|
+
|
|
1226
|
+
/** Minimal contact identity embedded on a partner booking request (hostUser, or the service owner). */
|
|
1227
|
+
export const PARTNER_BOOKING_CONTACT_SELECT = {
|
|
1228
|
+
id: true,
|
|
1229
|
+
email: true,
|
|
1230
|
+
givenName: true,
|
|
1231
|
+
familyName: true,
|
|
1232
|
+
} satisfies Prisma.UserSelect;
|
|
1233
|
+
|
|
1234
|
+
export type PartnerBookingContact = Prisma.UserGetPayload<{
|
|
1235
|
+
select: typeof PARTNER_BOOKING_CONTACT_SELECT;
|
|
1236
|
+
}>;
|
|
1237
|
+
|
|
1238
|
+
/** Minimal event ref embedded on a partner booking request. */
|
|
1239
|
+
export const PARTNER_BOOKING_BASH_EVENT_SELECT = {
|
|
1240
|
+
id: true,
|
|
1241
|
+
title: true,
|
|
1242
|
+
startDateTime: true,
|
|
1243
|
+
endDateTime: true,
|
|
1244
|
+
} satisfies Prisma.BashEventSelect;
|
|
1245
|
+
|
|
1246
|
+
export type PartnerBookingBashEventRef = Prisma.BashEventGetPayload<{
|
|
1247
|
+
select: typeof PARTNER_BOOKING_BASH_EVENT_SELECT;
|
|
1248
|
+
}>;
|
|
1249
|
+
|
|
1250
|
+
export const VENDOR_BOOKING_REQUEST_INCLUDE = {
|
|
1251
|
+
hostUser: { select: PARTNER_BOOKING_CONTACT_SELECT },
|
|
1252
|
+
vendorService: { include: { owner: { select: PARTNER_BOOKING_CONTACT_SELECT } } },
|
|
1253
|
+
bashEvent: { select: PARTNER_BOOKING_BASH_EVENT_SELECT },
|
|
1254
|
+
} satisfies Prisma.VendorBookingRequestInclude;
|
|
1255
|
+
|
|
1256
|
+
export type VendorBookingRequestExt = Prisma.VendorBookingRequestGetPayload<{
|
|
1257
|
+
include: typeof VENDOR_BOOKING_REQUEST_INCLUDE;
|
|
1258
|
+
}>;
|
|
1259
|
+
|
|
1260
|
+
export const EXHIBITOR_BOOKING_REQUEST_INCLUDE = {
|
|
1261
|
+
hostUser: { select: PARTNER_BOOKING_CONTACT_SELECT },
|
|
1262
|
+
exhibitorService: { include: { owner: { select: PARTNER_BOOKING_CONTACT_SELECT } } },
|
|
1263
|
+
bashEvent: { select: PARTNER_BOOKING_BASH_EVENT_SELECT },
|
|
1264
|
+
} satisfies Prisma.ExhibitorBookingRequestInclude;
|
|
1265
|
+
|
|
1266
|
+
export type ExhibitorBookingRequestExt = Prisma.ExhibitorBookingRequestGetPayload<{
|
|
1267
|
+
include: typeof EXHIBITOR_BOOKING_REQUEST_INCLUDE;
|
|
1268
|
+
}>;
|
|
1269
|
+
|
|
1270
|
+
export const SPONSOR_BOOKING_REQUEST_INCLUDE = {
|
|
1271
|
+
hostUser: { select: PARTNER_BOOKING_CONTACT_SELECT },
|
|
1272
|
+
sponsorService: { include: { owner: { select: PARTNER_BOOKING_CONTACT_SELECT } } },
|
|
1273
|
+
bashEvent: { select: PARTNER_BOOKING_BASH_EVENT_SELECT },
|
|
1274
|
+
} satisfies Prisma.SponsorBookingRequestInclude;
|
|
1275
|
+
|
|
1276
|
+
export type SponsorBookingRequestExt = Prisma.SponsorBookingRequestGetPayload<{
|
|
1277
|
+
include: typeof SPONSOR_BOOKING_REQUEST_INCLUDE;
|
|
1278
|
+
}>;
|
|
1279
|
+
|
|
1280
|
+
/** Fields common to all three partner booking request models (same name + type on every model).
|
|
1281
|
+
* `status` is intentionally excluded — Vendor/Exhibitor/SponsorBookingStatus are separate (if
|
|
1282
|
+
* byte-identical) enums, so each Ext type keeps its own nominal status field. */
|
|
1283
|
+
export type PartnerBookingRequestBase = Pick<
|
|
1284
|
+
VendorBookingRequestExt,
|
|
1285
|
+
| "id"
|
|
1286
|
+
| "createdAt"
|
|
1287
|
+
| "updatedAt"
|
|
1288
|
+
| "hostUserId"
|
|
1289
|
+
| "bashEventId"
|
|
1290
|
+
| "expectedGuests"
|
|
1291
|
+
| "eventDuration"
|
|
1292
|
+
| "eventDescription"
|
|
1293
|
+
| "specialRequests"
|
|
1294
|
+
| "contactPreference"
|
|
1295
|
+
| "urgency"
|
|
1296
|
+
| "paymentTiming"
|
|
1297
|
+
| "depositPercentage"
|
|
1298
|
+
| "competitorRestrictions"
|
|
1299
|
+
| "cancellationPolicy"
|
|
1300
|
+
| "pricingModelAllowList"
|
|
1301
|
+
| "paymentAmount"
|
|
1302
|
+
| "paymentStatus"
|
|
1303
|
+
| "stripePaymentIntentId"
|
|
1304
|
+
| "paidAt"
|
|
1305
|
+
| "respondedAt"
|
|
1306
|
+
| "feeStructure"
|
|
1307
|
+
| "percentageRate"
|
|
1308
|
+
| "hostUser"
|
|
1309
|
+
| "bashEvent"
|
|
1310
|
+
>;
|
|
1311
|
+
|
|
1312
|
+
/** Discriminated union of the three partner booking request types — `partnerType` is attached
|
|
1313
|
+
* by the API (it isn't a DB column) so callers can narrow without checking which service-ref key is present. */
|
|
1314
|
+
export type PartnerBookingRequest =
|
|
1315
|
+
| ({ partnerType: "vendor" } & VendorBookingRequestExt)
|
|
1316
|
+
| ({ partnerType: "exhibitor" } & ExhibitorBookingRequestExt)
|
|
1317
|
+
| ({ partnerType: "sponsor" } & SponsorBookingRequestExt);
|
|
1318
|
+
|
|
1194
1319
|
// Future type for venue unavailable dates (not yet implemented in database)
|
|
1195
1320
|
// To implement: Add VenueUnavailableDate model to Prisma schema
|
|
1196
1321
|
export interface UnavailableDate {
|
|
@@ -1583,12 +1708,40 @@ export const USER_DATA_SELECT_REVIEWS_COMMENTS = {
|
|
|
1583
1708
|
},
|
|
1584
1709
|
} satisfies Prisma.UserSelect;
|
|
1585
1710
|
|
|
1711
|
+
/** Plain `reviews` shape queried by `FRONT_END_USER_DATA_TO_SELECT` alone (no nested `comments`). */
|
|
1712
|
+
type PublicUserPlainReview = Prisma.UserGetPayload<{
|
|
1713
|
+
select: typeof FRONT_END_USER_DATA_TO_SELECT;
|
|
1714
|
+
}>["reviews"][number];
|
|
1715
|
+
|
|
1716
|
+
/** `reviews` shape when a query additionally merges in `USER_DATA_SELECT_REVIEWS_COMMENTS` on top of
|
|
1717
|
+
* `FRONT_END_USER_DATA_TO_SELECT` (nested `comments` included). */
|
|
1718
|
+
export type PublicUserReviewWithComments = Prisma.UserGetPayload<{
|
|
1719
|
+
select: typeof USER_DATA_SELECT_REVIEWS_COMMENTS;
|
|
1720
|
+
}>["reviews"][number];
|
|
1721
|
+
|
|
1722
|
+
type PublicUserBase = Prisma.UserGetPayload<{
|
|
1723
|
+
select: typeof FRONT_END_USER_DATA_TO_SELECT;
|
|
1724
|
+
}>;
|
|
1725
|
+
|
|
1726
|
+
/** Real `User` select shape for public profile surfaces — derived via `GetPayload` (like `PublicTeaserUser`)
|
|
1727
|
+
* so relation/computed fields (e.g. `reviews`, `contacts`) can't silently drift from what
|
|
1728
|
+
* `FRONT_END_USER_DATA_TO_SELECT` actually queries. The four relation fields below stay optional (not
|
|
1729
|
+
* required-but-nullable, as a strict `GetPayload` would make them) because some call sites — e.g. auth/session
|
|
1730
|
+
* flows — legitimately pass a scalar-only `User` row through this type without ever including them.
|
|
1731
|
+
* `reviews` is additionally re-widened to a union since some call sites merge in
|
|
1732
|
+
* `USER_DATA_SELECT_REVIEWS_COMMENTS` for nested review comments. */
|
|
1586
1733
|
export type PublicUser = Omit<
|
|
1587
|
-
|
|
1588
|
-
"userSubscription"
|
|
1589
|
-
> &
|
|
1590
|
-
|
|
1591
|
-
|
|
1734
|
+
PublicUserBase,
|
|
1735
|
+
"reviews" | "contacts" | "socialMediaProfiles" | "userSubscription"
|
|
1736
|
+
> &
|
|
1737
|
+
Partial<Pick<PublicUserBase, "contacts" | "socialMediaProfiles" | "userSubscription">> & {
|
|
1738
|
+
reviews?: (PublicUserPlainReview | PublicUserReviewWithComments)[] | null;
|
|
1739
|
+
};
|
|
1740
|
+
|
|
1741
|
+
/** Self-account (`/me`) select shape — derived via `GetPayload` the same way `PublicUser` is. */
|
|
1742
|
+
export type PrivateUser = Prisma.UserGetPayload<{
|
|
1743
|
+
select: typeof PRIVATE_USER_ACCOUNT_TO_SELECT;
|
|
1744
|
+
}>;
|
|
1592
1745
|
|
|
1593
1746
|
export type PublicStripeAccount = Pick<
|
|
1594
1747
|
StripeAccountExt,
|
package/src/index.ts
CHANGED
|
@@ -35,6 +35,8 @@ export * from "./userReportTypes.js";
|
|
|
35
35
|
export * from "./mirroredPrismaEnums.js";
|
|
36
36
|
export * from "./utils/featuredDiscoveryGeo.js";
|
|
37
37
|
export * from "./utils/organizationEntitlements.js";
|
|
38
|
+
export * from "./serviceTypeLabels.js";
|
|
39
|
+
export * from "./targetAudienceLabels.js";
|
|
38
40
|
|
|
39
41
|
// Re-export ALL Prisma enums as values (usable as runtime constants, e.g. ServiceTypes.Entertainment)
|
|
40
42
|
// Excludes enums already re-exported by definitions.ts, mirroredPrismaEnums.ts, and membershipDefinitions.ts:
|
|
@@ -813,6 +813,8 @@ export const MEMBERSHIP_FEATURES = {
|
|
|
813
813
|
SEARCH_PRIORITY: 'search_priority',
|
|
814
814
|
BASIC_ANALYTICS: 'basic_analytics',
|
|
815
815
|
VENDOR_DIRECTORY: 'vendor_directory',
|
|
816
|
+
/** Host-side perk: offer a vendor exclusive-category status for an event when sending a booking request. */
|
|
817
|
+
VENDOR_CATEGORY_EXCLUSIVITY: 'vendor_category_exclusivity',
|
|
816
818
|
TIER_BADGE: 'tier_badge',
|
|
817
819
|
|
|
818
820
|
// Elite features
|
|
@@ -854,6 +856,7 @@ export function hasFeatureAccess(userTier: MembershipTier, feature: string): boo
|
|
|
854
856
|
case MEMBERSHIP_FEATURES.SEARCH_PRIORITY:
|
|
855
857
|
case MEMBERSHIP_FEATURES.BASIC_ANALYTICS:
|
|
856
858
|
case MEMBERSHIP_FEATURES.VENDOR_DIRECTORY:
|
|
859
|
+
case MEMBERSHIP_FEATURES.VENDOR_CATEGORY_EXCLUSIVITY:
|
|
857
860
|
case MEMBERSHIP_FEATURES.TIER_BADGE:
|
|
858
861
|
return tierIndex >= 2; // Pro+
|
|
859
862
|
|
|
@@ -86,6 +86,22 @@ export const ServiceBookingSettlementStatus = {
|
|
|
86
86
|
|
|
87
87
|
export type ServiceBookingSettlementStatus = ServiceBookingSettlementStatusEnum;
|
|
88
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Display label for `ServiceBookingSettlementStatus` — consolidated from the hand-typed
|
|
91
|
+
* `STATUS_UI.label` copy in `EventPromoterBookingCard.tsx`. Icon/color styling stays local to
|
|
92
|
+
* that component (UI-specific, not a bash-common concern); only the text is shared here.
|
|
93
|
+
*/
|
|
94
|
+
export const ServiceBookingSettlementStatusLabel: Record<
|
|
95
|
+
ServiceBookingSettlementStatus,
|
|
96
|
+
string
|
|
97
|
+
> = {
|
|
98
|
+
Pending: "Awaiting settle",
|
|
99
|
+
Settled: "Settled",
|
|
100
|
+
SettlementPaymentFailed: "Payment failed",
|
|
101
|
+
SettlementHeld: "Held for review",
|
|
102
|
+
SettlementDisputed: "Disputed",
|
|
103
|
+
};
|
|
104
|
+
|
|
89
105
|
/**
|
|
90
106
|
* Mirrors Prisma `PricingModel`. Includes the Phase 1 additions
|
|
91
107
|
* `PER_PAID_ATTENDEE` and `PER_BASHPOINTS_ATTENDEE` introduced by the
|
|
@@ -180,6 +196,10 @@ export const CreditSourceType = {
|
|
|
180
196
|
SideQuestCompletion: "SideQuestCompletion",
|
|
181
197
|
SideQuestMilestone: "SideQuestMilestone",
|
|
182
198
|
CommunityQuestUnlock: "CommunityQuestUnlock",
|
|
199
|
+
CompetitionVote: "CompetitionVote",
|
|
200
|
+
CompetitionParticipation: "CompetitionParticipation",
|
|
201
|
+
CompetitionFinalist: "CompetitionFinalist",
|
|
202
|
+
CompetitionWin: "CompetitionWin",
|
|
183
203
|
} as const satisfies Record<CreditSourceTypeEnum, CreditSourceTypeEnum>;
|
|
184
204
|
|
|
185
205
|
export type CreditSourceType = CreditSourceTypeEnum;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ServiceTypes } from "@prisma/client";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Human-readable label for every `ServiceTypes` value — the raw enum ("EventServices",
|
|
5
|
+
* "EntertainmentServices") is not fit for display copy.
|
|
6
|
+
*
|
|
7
|
+
* Single source of truth for what was previously four drifted, hand-typed copies:
|
|
8
|
+
* `homeServicesSort.ts`, `CategoryRequestsPage.tsx`, `serviceCategorySuggestionApi.ts`,
|
|
9
|
+
* and the `TAB_CONFIG` labels in `HowServices.tsx`.
|
|
10
|
+
*
|
|
11
|
+
* Note: this is distinct from `SERVICE_TYPE_DISPLAY_LABEL` in `definitions.ts`, which only
|
|
12
|
+
* covers the two values `COMPLEMENTARY_SERVICE_TYPE` can produce (Vendors/EventServices) for
|
|
13
|
+
* "also list as" copy — that narrower map stays as-is.
|
|
14
|
+
*/
|
|
15
|
+
export const SERVICE_TYPE_LABELS: Record<ServiceTypes, string> = {
|
|
16
|
+
[ServiceTypes.EntertainmentServices]: "Entertainment",
|
|
17
|
+
[ServiceTypes.EventServices]: "Event Services",
|
|
18
|
+
[ServiceTypes.Vendors]: "Vendors",
|
|
19
|
+
[ServiceTypes.Exhibitors]: "Exhibitors",
|
|
20
|
+
[ServiceTypes.Sponsors]: "Sponsors",
|
|
21
|
+
[ServiceTypes.Venues]: "Venues",
|
|
22
|
+
[ServiceTypes.Organizations]: "Organizations",
|
|
23
|
+
[ServiceTypes.Volunteers]: "Volunteers",
|
|
24
|
+
};
|
package/src/sideQuestIdeas.ts
CHANGED
|
@@ -40,7 +40,7 @@ export const SIDE_QUEST_CATEGORY_META: Record<
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
/** Phase 1 host-selectable quest types */
|
|
43
|
-
export const SIDE_QUEST_PHASE1_TYPES: SideQuestTypeId[] = ["Qr", "Code"];
|
|
43
|
+
export const SIDE_QUEST_PHASE1_TYPES: SideQuestTypeId[] = ["Qr", "Code", "Vote"];
|
|
44
44
|
|
|
45
45
|
export const SIDE_QUEST_TYPE_META: Record<
|
|
46
46
|
SideQuestTypeId,
|
|
@@ -79,7 +79,7 @@ export const SIDE_QUEST_TYPE_META: Record<
|
|
|
79
79
|
Vote: {
|
|
80
80
|
label: "Vote Quest",
|
|
81
81
|
description: "Completes after voting in a competition.",
|
|
82
|
-
phase1:
|
|
82
|
+
phase1: true,
|
|
83
83
|
},
|
|
84
84
|
Sponsor: {
|
|
85
85
|
label: "Sponsor Quest",
|
package/src/sideQuestTypes.ts
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { AgeRange, Education, Gender, Occupation } from "@prisma/client";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Display labels for `BashEvent`/`Service` target-audience demographics — consolidated from
|
|
5
|
+
* byte-identical copies that lived in `WhoTargetAudience.tsx` (bash event wizard) and
|
|
6
|
+
* `ServicesTargetAudience.tsx` (service wizard). Follows the `IncomeRangeLabel` precedent in
|
|
7
|
+
* `definitions.ts`.
|
|
8
|
+
*/
|
|
9
|
+
export const AgeRangeLabel: Record<AgeRange, string> = {
|
|
10
|
+
NoPreference: "Anyone",
|
|
11
|
+
Sixteen_17: "16-17",
|
|
12
|
+
EighteenPlus: "18+",
|
|
13
|
+
Eighteen_20: "18-20",
|
|
14
|
+
TwentyOnePlus: "21+",
|
|
15
|
+
TwentyOne_25: "21-25",
|
|
16
|
+
TwentySix_34: "26-34",
|
|
17
|
+
ThirtyFive_49: "35-49",
|
|
18
|
+
Fifty_64: "50-64",
|
|
19
|
+
SixtyFivePlus: "65+",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const GenderLabel: Record<Gender, string> = {
|
|
23
|
+
NoPreference: "Anyone",
|
|
24
|
+
Male: "Male",
|
|
25
|
+
Female: "Female",
|
|
26
|
+
Other: "Other",
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const OccupationLabel: Record<Occupation, string> = {
|
|
30
|
+
NoPreference: "Anyone",
|
|
31
|
+
Students: "Students",
|
|
32
|
+
Entrepreneurs: "Entrepreneurs",
|
|
33
|
+
SmallBusinesses: "Small Businesses",
|
|
34
|
+
Corporations: "Corporations",
|
|
35
|
+
Professionals: "Professionals",
|
|
36
|
+
Creatives: "Creatives",
|
|
37
|
+
AngelInvestors: "Angel Investors",
|
|
38
|
+
FamilyOffices: "Family Offices",
|
|
39
|
+
Retirees: "Retirees",
|
|
40
|
+
Academics: "Academics",
|
|
41
|
+
Government: "Government",
|
|
42
|
+
NonProfits: "Non-Profits",
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const EducationLabel: Record<Education, string> = {
|
|
46
|
+
NoPreference: "Anyone",
|
|
47
|
+
HighSchool: "High School",
|
|
48
|
+
SomeCollege: "Some College",
|
|
49
|
+
InCollege: "In College",
|
|
50
|
+
GraduateStudent: "Graduate Students",
|
|
51
|
+
Bachelors: "Bachelor's Degree",
|
|
52
|
+
Masters: "Master's Degree",
|
|
53
|
+
Doctorate: "Doctorate",
|
|
54
|
+
};
|