@bash-app/bash-common 29.42.1 → 29.42.2
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/README.md +8 -8
- package/package.json +47 -47
- package/prisma/schema.prisma +1623 -1623
- package/src/definitions.ts +608 -608
- package/src/extendedSchemas.ts +557 -556
- package/src/index.ts +16 -16
- package/src/utils/addressUtils.ts +173 -173
- package/src/utils/apiUtils.ts +76 -76
- package/src/utils/awsS3Utils.ts +99 -99
- package/src/utils/dateTimeUtils.ts +199 -199
- package/src/utils/paymentUtils.ts +56 -56
- package/src/utils/promoCodesUtils.ts +29 -29
- package/src/utils/qrCodeUtils.ts +23 -23
- package/src/utils/recurrenceUtils.ts +175 -175
- package/src/utils/service/serviceUtils.ts +121 -121
- package/src/utils/service/venueUtils.ts +45 -45
- package/src/utils/sortUtils.ts +28 -28
- package/src/utils/stripeAccountUtils.ts +11 -11
- package/src/utils/ticketListUtils.ts +78 -78
- package/src/utils/urlUtils.ts +29 -29
- package/tsconfig.json +19 -19
package/src/definitions.ts
CHANGED
|
@@ -1,608 +1,608 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BashEventDressTags,
|
|
3
|
-
BashEventType,
|
|
4
|
-
BashEventVibeTags,
|
|
5
|
-
Contact,
|
|
6
|
-
DayOfWeek,
|
|
7
|
-
Prisma,
|
|
8
|
-
// Rate,
|
|
9
|
-
ServiceTypes,
|
|
10
|
-
Ticket,
|
|
11
|
-
TicketTier,
|
|
12
|
-
User,
|
|
13
|
-
YearsOfExperience
|
|
14
|
-
} from "@prisma/client";
|
|
15
|
-
import { ServiceExt, CheckoutExt, PublicUser, VolunteerServiceExt, BashEventExt} from "./extendedSchemas";
|
|
16
|
-
|
|
17
|
-
export const PASSWORD_MIN_LENGTH = 8 as const;
|
|
18
|
-
export const PASSWORD_REQUIREMENTS_REGEX = new RegExp(String.raw`^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&^#])[A-Za-z\d@$!%*?&^#]{${PASSWORD_MIN_LENGTH},}$`);
|
|
19
|
-
export const BASH_FEE_PERCENTAGE = 0.10;
|
|
20
|
-
export const GOOGLE_CALLBACK_URL = '/auth/google/callback' as const;
|
|
21
|
-
export const CHECKOUT_RETURN_SUCCESS_URL = `/checkout-return/success/{CHECKOUT_SESSION_ID}` as const;
|
|
22
|
-
export const CHECKOUT_RETURN_CANCEL_URL = `/checkout-return/cancel/{CHECKOUT_SESSION_ID}` as const;
|
|
23
|
-
export const CHECKOUT_RETURN_SUCCESS_URL_PAGE = '/checkout-return/success/$checkoutSessionId' as const;
|
|
24
|
-
export const CHECKOUT_RETURN_CANCEL_URL_PAGE = '/checkout-return/cancel/$checkoutSessionId' as const;
|
|
25
|
-
export const DONATION_CHECKOUT_RETURN_SUCCESS_URL = `/donation-checkout-return/success/{CHECKOUT_SESSION_ID}` as const;
|
|
26
|
-
export const DONATION_CHECKOUT_RETURN_CANCEL_URL = `/donation-checkout-return/cancel/{CHECKOUT_SESSION_ID}` as const;
|
|
27
|
-
export const DONATION_CHECKOUT_RETURN_SUCCESS_URL_PAGE = '/donation-checkout-return/success/$checkoutSessionId' as const;
|
|
28
|
-
export const DONATION_CHECKOUT_RETURN_CANCEL_URL_PAGE = '/donation-checkout-return/cancel/$checkoutSessionId' as const;
|
|
29
|
-
export const VERIFICATION_RETURN_URL = `/sign-up` as const;
|
|
30
|
-
export const BASH_DETAIL_URL = `/bash-detail` as const;
|
|
31
|
-
export const SERVICE_PAGE_URL = `/service-page` as const;
|
|
32
|
-
export const LOGIN_URL = `/login` as const;
|
|
33
|
-
export const TICKET_DETAILS = `/ticket-details` as const;
|
|
34
|
-
|
|
35
|
-
export const SWR_KEY_AUTH_TOKEN = "auth-token" as const;
|
|
36
|
-
|
|
37
|
-
export const PRICE_DOLLARS_AND_CENTS_RATIO = 100 as const;
|
|
38
|
-
|
|
39
|
-
export const MIN_AMOUNT_OF_TICKETS_FOR_PUBLIC_EVENT_TO_SHOW = 0 as const;
|
|
40
|
-
export const DEFAULT_MAX_NUMBER_OF_TICKETS = 35 as const
|
|
41
|
-
export const MIN_NUMBER_OF_TICKETS = 0 as const;
|
|
42
|
-
|
|
43
|
-
export const MAX_NUMBER_OF_FREE_TICKETS_PER_USER_FOR_A_BASH_EVENT = 100 as const;
|
|
44
|
-
export const MAX_NUMBER_OF_TICKETS_PER_REQUEST_FOR_A_BASH_EVENT = 50 as const;
|
|
45
|
-
|
|
46
|
-
export const MONTHS_PREVIOUS_THAT_STRIPE_ACCOUNTS_WILL_BE_SEARCHED_BY_EMAIL = 1 as const;
|
|
47
|
-
|
|
48
|
-
export const HTTP_CODE_OK = 200 as const;
|
|
49
|
-
export const HTTP_CODE_TEMPORARY_REDIRECT = 307 as const;
|
|
50
|
-
export const HTTP_CODE_INTERNAL_SERVER_ERR = 500 as const
|
|
51
|
-
export const HTTP_CODE_BAD_REQUEST = 400 as const;
|
|
52
|
-
export const HTTP_CODE_UNAUTHORIZED = 401 as const;
|
|
53
|
-
export const HTTP_CODE_NOT_FOUND = 404 as const;
|
|
54
|
-
export const ERR_UNAUTHORIZED_REQUEST = "Unauthorized to perform requested action. Have you logged in?" as const;
|
|
55
|
-
|
|
56
|
-
export const URL_PARAMS_BASH_EVENT_ID = 'bashEventId' as const;
|
|
57
|
-
export const URL_PARAMS_BASH_EVENT_TITLE = 'bashEventTitle' as const;
|
|
58
|
-
export const URL_PARAMS_BASH_EVENT_DESC = 'bashEventDesc' as const;
|
|
59
|
-
export const URL_PARAMS_BASH_EVENT_COVER_PHOTO = 'bashEventCoverPhoto' as const;
|
|
60
|
-
export const URL_PARAMS_EMAIL = 'email' as const;
|
|
61
|
-
export const URL_PARAMS_OTP_CODE = 'code' as const;
|
|
62
|
-
export const URL_PARAMS_INCLUDE = 'include' as const;
|
|
63
|
-
export const URL_PARAMS_REDIRECT = 'redirect' as const;
|
|
64
|
-
export const URL_PARAMS_GOOGLE_ACCESS_CODE = 'code' as const;
|
|
65
|
-
export const URL_PARAMS_LINKED_IN_CODE = 'code' as const;
|
|
66
|
-
export const URL_PARAMS_STATE = 'state' as const;
|
|
67
|
-
|
|
68
|
-
export const URL_PARAMS_TICKET_LIST_DELIM = ',' as const;
|
|
69
|
-
export const URL_PARAMS_TICKET_TIER_ID_NUMBER_OF_TICKETS_DATE_DELIM = '__' as const
|
|
70
|
-
export const URL_PARAMS_NUMBER_OF_TICKETS_TICKETS_DATE_DELIM = '~~' as const
|
|
71
|
-
export const URL_PARAMS_TICKETS_DATE_DELIM = ';;' as const
|
|
72
|
-
|
|
73
|
-
export const URL_INCLUDE_QUERY_PARAM_DELIM = ',' as const;
|
|
74
|
-
export const URL_INCLUDE_PRISMA_DATA_KEYS_DELIM = '.' as const;
|
|
75
|
-
|
|
76
|
-
export const DEFAULT_PRISMA_TTL_SECONDS = 60 as const;
|
|
77
|
-
export const PRISMA_MEDIA_TTL_SECONDS = 60 * 5; // 5 hours
|
|
78
|
-
export const PRISMA_USER_TTL_SECONDS = 60 * 7; // 7 hours
|
|
79
|
-
export const PRISMA_BASH_EVENT_TTL_SECONDS = 60 as const;
|
|
80
|
-
export const PRISMA_SERVICE_TTL_SECONDS = 60 as const;
|
|
81
|
-
|
|
82
|
-
export const DEBOUNCE_WAIT = 1000 as const;
|
|
83
|
-
|
|
84
|
-
export const ASSET_KEY_DELIM = '__' as const;
|
|
85
|
-
export const ASSET_MAX_MD5_BYTE_LENGTH = 1024 * 100; // 100kb
|
|
86
|
-
|
|
87
|
-
export const MIN_NUMBER_OF_HOURS = 1;
|
|
88
|
-
export const DEFAULT_MAX_NUMBER_OF_HOURS = 24;
|
|
89
|
-
|
|
90
|
-
export const SERVICE_LINK_DATA_TO_INCLUDE = {
|
|
91
|
-
link: true,
|
|
92
|
-
} satisfies Prisma.ServiceLinkInclude;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
// export type ServiceSpecificName = keyof Pick<
|
|
96
|
-
// ServiceExt,
|
|
97
|
-
// "eventService" |
|
|
98
|
-
// "entertainmentService" |
|
|
99
|
-
// "vendor" |
|
|
100
|
-
// "exhibitor" |
|
|
101
|
-
// "sponsor" |
|
|
102
|
-
// "venue" |
|
|
103
|
-
// "organization"
|
|
104
|
-
// >;
|
|
105
|
-
|
|
106
|
-
export const VENUE_DATA_TO_INCLUDE = {
|
|
107
|
-
|
|
108
|
-
} satisfies Prisma.VenueInclude;
|
|
109
|
-
|
|
110
|
-
export const VENDOR_DATA_TO_INCLUDE = {
|
|
111
|
-
crowdSize: true,
|
|
112
|
-
} satisfies Prisma.VendorInclude;
|
|
113
|
-
|
|
114
|
-
export const VOLUNTEER_DATA_TO_INCLUDE = {
|
|
115
|
-
links: {
|
|
116
|
-
include: {
|
|
117
|
-
serviceLinks: true,
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
media: true,
|
|
121
|
-
serviceRange: true,
|
|
122
|
-
} satisfies Prisma.VolunteerServiceInclude;
|
|
123
|
-
|
|
124
|
-
export type DateTimeArgType = Date | string | undefined | null;
|
|
125
|
-
export type RequiredStripeInfoMissingErrorDataType = { [k in keyof User]?: { type: string, label: string } };
|
|
126
|
-
export type ContactOrUser = Contact | PublicUser;
|
|
127
|
-
|
|
128
|
-
export type UnionFromArray<T extends ReadonlyArray<any>> = T[number];
|
|
129
|
-
export type ValueOf<T> = T[keyof T];
|
|
130
|
-
|
|
131
|
-
export type FilterFields = {
|
|
132
|
-
price: string[];
|
|
133
|
-
ageRequirement: string[];
|
|
134
|
-
allowed: string[];
|
|
135
|
-
notAllowed: string[];
|
|
136
|
-
crowd: string[];
|
|
137
|
-
vibe: string[];
|
|
138
|
-
included: string[];
|
|
139
|
-
hostRating: string[];
|
|
140
|
-
specialOffers: string[];
|
|
141
|
-
eventFormat: string[];
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
export type TicketTierWherePriceIsAString = Omit<TicketTier, 'price'> & {price: string} & {cannotDelete: boolean};
|
|
145
|
-
|
|
146
|
-
export interface DeletedAndHiddenTiers {
|
|
147
|
-
deletedTiers: TicketTier[];
|
|
148
|
-
hiddenTiers: TicketTier[];
|
|
149
|
-
errorType?: ApiErrorType;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export interface AttendeeOfBashEvent {
|
|
153
|
-
user: PublicUser;
|
|
154
|
-
tickets: Ticket[];
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
export interface FirstFewAttendingBashEvent {
|
|
158
|
-
checkouts: CheckoutExt[];
|
|
159
|
-
totalTicketCount: number;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export interface SignInEmailWithCode {
|
|
163
|
-
email: string;
|
|
164
|
-
code: string;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export interface MoreOptionsMenuItem {
|
|
168
|
-
name: string;
|
|
169
|
-
href?: string;
|
|
170
|
-
onClick?: () => void;
|
|
171
|
-
icon?: React.ElementType;
|
|
172
|
-
items: MoreOptionsMenuItem[];
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export interface LinkedInAuthData {
|
|
176
|
-
accessToken: string;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export interface NumberOfTicketsForDate {
|
|
180
|
-
numberOfTickets: number;
|
|
181
|
-
ticketDateTime: DateTimeArgType;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export interface AvailableTicketsForTicketTier {
|
|
185
|
-
ticketTier: TicketTier;
|
|
186
|
-
availableTickets: NumberOfTicketsForDate[];
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export interface AvailableTicketsForTicketTierForDate {
|
|
190
|
-
ticketTier: TicketTier,
|
|
191
|
-
availableTicketsForDate: NumberOfTicketsForDate;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export interface AvailableTicketsForTicketTier {
|
|
195
|
-
ticketTier: TicketTier;
|
|
196
|
-
availableTickets: NumberOfTicketsForDate[];
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export interface NumberOfHoursForDate {
|
|
200
|
-
numberOfHours: number;
|
|
201
|
-
bookingDateTime: DateTimeArgType;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// export interface AvailableNumberOfHoursForRate {
|
|
205
|
-
// rate: Rate;
|
|
206
|
-
// availableHours: NumberOfHoursForDate[];
|
|
207
|
-
// }
|
|
208
|
-
|
|
209
|
-
// export interface AvailableHoursForRateForDate {
|
|
210
|
-
// rate: Rate,
|
|
211
|
-
// availableHoursForDate: NumberOfHoursForDate;
|
|
212
|
-
// }
|
|
213
|
-
|
|
214
|
-
// export interface AvailableHoursForRate {
|
|
215
|
-
// rate: Rate;
|
|
216
|
-
// availableHours: NumberOfHoursForDate[];
|
|
217
|
-
// }
|
|
218
|
-
|
|
219
|
-
// export interface DeletedAndHiddenRates {
|
|
220
|
-
// deletedRates: Rate[];
|
|
221
|
-
// hiddenRates: Rate[];
|
|
222
|
-
// errorType?: ApiErrorType;
|
|
223
|
-
// }
|
|
224
|
-
|
|
225
|
-
export interface SignInEmailWithPassword {
|
|
226
|
-
email: string;
|
|
227
|
-
password: string;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
export interface ForgotPassword {
|
|
231
|
-
email: string;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export interface ResetPassword {
|
|
235
|
-
email: string;
|
|
236
|
-
password: string;
|
|
237
|
-
otp: string;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
export interface ApiResult<T, P extends ErrorDataType = ErrorDataType> {
|
|
241
|
-
data?: T;
|
|
242
|
-
status?: number;
|
|
243
|
-
token?: string;
|
|
244
|
-
error?: string;
|
|
245
|
-
errorType?: ApiErrorType;
|
|
246
|
-
errorData?: P;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export enum ApiErrorType {
|
|
250
|
-
Unknown = 1,
|
|
251
|
-
UserAlreadyHasMaximumAllowedFreeTicketsForBashEvent,
|
|
252
|
-
BashHasNoMoreTicketsAvailable,
|
|
253
|
-
NotEnoughTicketsAvailable,
|
|
254
|
-
UserExceededMaxTicketNumberForOneRequest,
|
|
255
|
-
UserDoesNotExist,
|
|
256
|
-
StripeCreateCheckoutSessionFailed,
|
|
257
|
-
StripeUserInfoIncomplete,
|
|
258
|
-
TicketsAlreadyPurchasedUsingThisCheckoutSession,
|
|
259
|
-
StripeAccountHasNotSetupTaxData,
|
|
260
|
-
StripeCheckoutSessionIncomplete,
|
|
261
|
-
CouldNotSendEmail,
|
|
262
|
-
TicketTierHiddenAsAtLeastOneTicketHasAlreadyBeenPurchased,
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
export type ErrorDataType = Record<RecordKey, any>;
|
|
266
|
-
|
|
267
|
-
export const StripeErrorToApiErrorType = {
|
|
268
|
-
"stripe_tax_inactive": ApiErrorType.StripeAccountHasNotSetupTaxData
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
export interface StripeCreateBashEventTicketsCheckoutSessionArgs {
|
|
272
|
-
bashEventId: string;
|
|
273
|
-
currency: string;
|
|
274
|
-
paymentMethodType: string;
|
|
275
|
-
ticketListStr: string;
|
|
276
|
-
promoCode?: string;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
export interface StripeCreateBashEventDonationCheckoutSessionArgs {
|
|
280
|
-
bashEventId: string;
|
|
281
|
-
currency: string;
|
|
282
|
-
paymentMethodType: string;
|
|
283
|
-
donationAmount: number;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
export interface StripeCreateServiceSubscriptionCheckoutSessionArgs {
|
|
287
|
-
serviceId: string;
|
|
288
|
-
currency: string;
|
|
289
|
-
paymentMethodType: string;
|
|
290
|
-
promoCode?: string;
|
|
291
|
-
successUrl: string;
|
|
292
|
-
cancelUrl: string;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
export interface StripeCreateAccountPortalSessionArgs {
|
|
296
|
-
stripeAccountId: string;
|
|
297
|
-
returnUrl: string;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
export type StripeSessionRedirect = {
|
|
301
|
-
stripeAccountIdDB: string;
|
|
302
|
-
redirectUrl: string;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// export type ServiceStripeSessionRedirect = {
|
|
306
|
-
// service: ServiceExt;
|
|
307
|
-
// } & StripeSessionRedirect;
|
|
308
|
-
|
|
309
|
-
// export type BashEventStripeSessionRedirect = {
|
|
310
|
-
// bashEvent: BashEventExt;
|
|
311
|
-
// } & StripeSessionRedirect;
|
|
312
|
-
|
|
313
|
-
// export type StripeLinkingStatus = "Complete" | "Incomplete";
|
|
314
|
-
|
|
315
|
-
export type StripeAddress = {
|
|
316
|
-
line1: string;
|
|
317
|
-
line2: string;
|
|
318
|
-
city: string;
|
|
319
|
-
state: string;
|
|
320
|
-
zipCode: string;
|
|
321
|
-
country: string;
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
export type StripeLinkingStatus = {
|
|
325
|
-
isOnboarded: boolean;
|
|
326
|
-
hasOutstandingRequirements: boolean;
|
|
327
|
-
paymentsEnabled: boolean;
|
|
328
|
-
taxMonitoringEnabled: boolean;
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
export type StripeBusinessDataPublic = {
|
|
332
|
-
logoUrl?: string; //not possible to fetch logo directly from stripe
|
|
333
|
-
businessName?: string;
|
|
334
|
-
businessNameDBA?: string;
|
|
335
|
-
supportEmail?: string;
|
|
336
|
-
supportPhone?: string;
|
|
337
|
-
supportURL?: string;
|
|
338
|
-
address?: StripeAddress;
|
|
339
|
-
accountType: string;
|
|
340
|
-
};
|
|
341
|
-
|
|
342
|
-
export type StripeBusinessDataOwned = {
|
|
343
|
-
stripeAccountDBId: string;
|
|
344
|
-
|
|
345
|
-
bankAccount?: string;
|
|
346
|
-
linkingStatus: StripeLinkingStatus;
|
|
347
|
-
|
|
348
|
-
createdDate: string;
|
|
349
|
-
updatedDate: string;
|
|
350
|
-
} & StripeBusinessDataPublic;
|
|
351
|
-
|
|
352
|
-
export interface StripeConfirmPayment {
|
|
353
|
-
checkoutSessionId: string;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
export interface StripeAccountLinkArgs {
|
|
357
|
-
userId?: string;
|
|
358
|
-
returnUrl: string;
|
|
359
|
-
refreshUrl: string;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
export interface StripeBusinessLinkArgs {
|
|
363
|
-
businessId: string;
|
|
364
|
-
returnUrl: string;
|
|
365
|
-
refreshUrl: string;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
export interface StripeConfirmPaymentResult {
|
|
369
|
-
bashEventId: string;
|
|
370
|
-
numberOfTickets: number;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
export interface IMediaUploadArgs {
|
|
374
|
-
mimetype: string;
|
|
375
|
-
idOfLinkedPrismaEntry: string;
|
|
376
|
-
assetKey: string;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
export interface IPreSignedUrlArgs {
|
|
380
|
-
assetKey: string;
|
|
381
|
-
mimetype: string;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
export interface IPreSignedUrlResult {
|
|
385
|
-
assetKey: string;
|
|
386
|
-
preSignedUrl: string | undefined;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
export const ASSET_MIME_TYPES_TO_EXT = {
|
|
390
|
-
'image/jpeg': '.jpeg',
|
|
391
|
-
'image/png': '.png',
|
|
392
|
-
'image/gif': '.gif',
|
|
393
|
-
'image/bmp': '.bmp',
|
|
394
|
-
'image/webp': '.webp',
|
|
395
|
-
'image/svg+xml': '.svg',
|
|
396
|
-
'image/tiff': '.tiff',
|
|
397
|
-
'image/vnd': '.ico',
|
|
398
|
-
'video/mp4': '.mp4',
|
|
399
|
-
// '.webm',
|
|
400
|
-
// '.ogg',
|
|
401
|
-
// '.avi',
|
|
402
|
-
// '.mov',
|
|
403
|
-
// '.mkv'
|
|
404
|
-
};
|
|
405
|
-
export const VALID_ASSET_MIME_TYPES = Object.keys(ASSET_MIME_TYPES_TO_EXT);
|
|
406
|
-
|
|
407
|
-
export const VibeTagsToString: { [key in BashEventVibeTags]: string } = {
|
|
408
|
-
[BashEventVibeTags.Wild]: "Wild",
|
|
409
|
-
[BashEventVibeTags.Calm]: "Chill",
|
|
410
|
-
}
|
|
411
|
-
export const DressTagsToString: { [key in BashEventDressTags]: string } = {
|
|
412
|
-
[BashEventDressTags.Casual]: "Casual",
|
|
413
|
-
[BashEventDressTags.BusinessCasual]: "Business casual",
|
|
414
|
-
[BashEventDressTags.Formal]: "Formal"
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
// export const ServicesTagsToString: { [key in ServicesTags]: string } = {
|
|
418
|
-
// [ServicesTags.Fast]: "Fast",
|
|
419
|
-
// [ServicesTags.Reliable]: "Reliable",
|
|
420
|
-
// [ServicesTags.AwardRecipient]: "Award recipient"
|
|
421
|
-
// }
|
|
422
|
-
|
|
423
|
-
export const DayOfWeekToString: { [key in DayOfWeek]: string } = {
|
|
424
|
-
[DayOfWeek.Sunday]: 'S',
|
|
425
|
-
[DayOfWeek.Monday]: 'M',
|
|
426
|
-
[DayOfWeek.Tuesday]: 'T',
|
|
427
|
-
[DayOfWeek.Wednesday]: 'W',
|
|
428
|
-
[DayOfWeek.Thursday]: 'T',
|
|
429
|
-
[DayOfWeek.Friday]: 'F',
|
|
430
|
-
[DayOfWeek.Saturday]: 'S',
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
export const YearsOfExperienceToString: { [key in YearsOfExperience]: string } = {
|
|
435
|
-
[YearsOfExperience.LessThanOneYear]: 'Less than one year',
|
|
436
|
-
[YearsOfExperience.OneToThreeYears]: 'One to three years',
|
|
437
|
-
[YearsOfExperience.ThreeToFiveYears]: 'Three to five years',
|
|
438
|
-
[YearsOfExperience.FivePlusYears]: 'More than five years',
|
|
439
|
-
};
|
|
440
|
-
|
|
441
|
-
export type BashEventTypeToStringType = {
|
|
442
|
-
[key in BashEventType]: string;
|
|
443
|
-
};
|
|
444
|
-
export const BashEventTypeToString: BashEventTypeToStringType = {
|
|
445
|
-
[BashEventType.AfterParty]: "After-Party",
|
|
446
|
-
[BashEventType.AnimeAndCosplayFestival]: "Anime and Cosplay Festival",
|
|
447
|
-
[BashEventType.AnniversaryCelebration]: "Anniversary Celebration",
|
|
448
|
-
[BashEventType.ArtExhibitOpening]: "Art Exhibit Opening",
|
|
449
|
-
[BashEventType.ArtAndCraftNight]: "Art and Craft Night",
|
|
450
|
-
[BashEventType.BBQCookout]: "BBQ Cookout",
|
|
451
|
-
[BashEventType.BabyShower]: "Baby Shower",
|
|
452
|
-
[BashEventType.BachelorOrBacheloretteParty]: "Bachelor/Bachelorette Party",
|
|
453
|
-
[BashEventType.BeachParty]: "Beach Party",
|
|
454
|
-
[BashEventType.Birthday]: "Birthday",
|
|
455
|
-
[BashEventType.BoatPartyOrCruise]: "Boat Party or Cruise",
|
|
456
|
-
[BashEventType.Bonfire]: "Bonfire",
|
|
457
|
-
[BashEventType.BookClubMeeting]: "Book Club Meeting",
|
|
458
|
-
[BashEventType.BridalShower]: "Bridal Shower",
|
|
459
|
-
[BashEventType.BrunchGathering]: "Brunch Gathering",
|
|
460
|
-
[BashEventType.CarShow]: "Car Show",
|
|
461
|
-
[BashEventType.CarnivalAndFair]: "Carnival and Fair",
|
|
462
|
-
[BashEventType.CasinoNight]: "Casino Night",
|
|
463
|
-
[BashEventType.CasualMixer]: "Casual Mixer",
|
|
464
|
-
[BashEventType.CharityBall]: "Charity Ball",
|
|
465
|
-
[BashEventType.CharityFundraiser]: "Charity Fundraiser",
|
|
466
|
-
[BashEventType.ChristmasParty]: "Christmas Party",
|
|
467
|
-
[BashEventType.ChurchEvent]: "Church Event",
|
|
468
|
-
[BashEventType.CircusOrCarnivalParty]: "Circus/Carnival Party",
|
|
469
|
-
[BashEventType.CocktailParty]: "Cocktail Party",
|
|
470
|
-
[BashEventType.CollegeParty_FraternityOrSorority]: "College Party (Fraternity/Sorority)",
|
|
471
|
-
[BashEventType.ComedyShowOrStandUpComedyNight]: "Comedy Show Or Stand-Up Comedy Night",
|
|
472
|
-
[BashEventType.ComicConvention]: "Comic Convention",
|
|
473
|
-
[BashEventType.Competition]: "Competition",
|
|
474
|
-
[BashEventType.Concert]: "Concert",
|
|
475
|
-
[BashEventType.CookingCompetition]: "Cooking Competition",
|
|
476
|
-
[BashEventType.CorporateEventOrOfficeParty]: "Corporate Event/Office Party",
|
|
477
|
-
[BashEventType.CostumeParty_Theme_Based]: "Costume Party (Theme-Based)",
|
|
478
|
-
[BashEventType.CulturalFestival]: "Cultural Festival",
|
|
479
|
-
[BashEventType.DanceParty]: "Dance Party",
|
|
480
|
-
[BashEventType.DesertRave]: "Desert Rave",
|
|
481
|
-
[BashEventType.DiscoNight]: "Disco Night",
|
|
482
|
-
[BashEventType.EasterGathering]: "Easter Gathering",
|
|
483
|
-
[BashEventType.EngagementParty]: "Engagement Party",
|
|
484
|
-
[BashEventType.ESportsGamingTournament]: "E-sports Gaming Tournament",
|
|
485
|
-
[BashEventType.ExclusiveLuxuryRetreat]: "Exclusive Luxury Retreat",
|
|
486
|
-
[BashEventType.FantasyThemedParty]: "Fantasy Themed Party",
|
|
487
|
-
[BashEventType.FashionShow]: "Fashion Show",
|
|
488
|
-
[BashEventType.Fireside]: "Fireside",
|
|
489
|
-
[BashEventType.FitnessFestival]: "Fitness Festival",
|
|
490
|
-
[BashEventType.FlashMob]: "Flash Mob",
|
|
491
|
-
[BashEventType.Festival]: "Festival",
|
|
492
|
-
[BashEventType.FestivalFilm]: "Film Festival",
|
|
493
|
-
[BashEventType.FestivalFood]: "Food Festival",
|
|
494
|
-
[BashEventType.FundraisingEvent]: "Fundraising Event",
|
|
495
|
-
[BashEventType.GalaDinner]: "Gala Dinner",
|
|
496
|
-
[BashEventType.GameNight]: "Game Night",
|
|
497
|
-
[BashEventType.GamingEvent]: "Gaming Event",
|
|
498
|
-
[BashEventType.GardenParty]: "Garden Party",
|
|
499
|
-
[BashEventType.GoingAwayPartyOrFarewell]: "Going-away Party or Farewell",
|
|
500
|
-
[BashEventType.GraduationParty]: "Graduation Party",
|
|
501
|
-
[BashEventType.HalloweenCostumeParty]: "Halloween Costume Party",
|
|
502
|
-
[BashEventType.HanukkahParty]: "Hanukkah Party",
|
|
503
|
-
[BashEventType.HistoricalEraParty]: "Historical Era Party",
|
|
504
|
-
[BashEventType.HolidayParty]: "Holiday Party",
|
|
505
|
-
[BashEventType.HouseParty]: "House Party",
|
|
506
|
-
[BashEventType.HousewarmingParty]: "Housewarming Party",
|
|
507
|
-
[BashEventType.KaraokeNight]: "Karaoke Night",
|
|
508
|
-
[BashEventType.KiteFlyingFestival]: "Kite Flying Festival",
|
|
509
|
-
[BashEventType.LiveBandPerformanceInALocalVenue]: "Live Band Performance in a Local Venue",
|
|
510
|
-
[BashEventType.Luau]: "Luau",
|
|
511
|
-
[BashEventType.MansionParty]: "Mansion Party",
|
|
512
|
-
[BashEventType.MardiGras]: "Mardi Gras",
|
|
513
|
-
[BashEventType.MasqueradeBall]: "Masquerade Ball",
|
|
514
|
-
[BashEventType.MotorcycleRally]: "Motorcycle Rally",
|
|
515
|
-
[BashEventType.MovieNight]: "Movie Night",
|
|
516
|
-
[BashEventType.MoviePremiere]: "Movie Premiere",
|
|
517
|
-
[BashEventType.MusicFestival]: "Music Festival",
|
|
518
|
-
[BashEventType.NewYearsEveCelebration]: "New Year's Eve Celebration",
|
|
519
|
-
[BashEventType.OpenMicNight]: "Open Mic Night",
|
|
520
|
-
[BashEventType.OutdoorActivity]: "Outdoor Activity",
|
|
521
|
-
[BashEventType.OutdoorConcert]: "Outdoor Concert",
|
|
522
|
-
[BashEventType.OutdoorMovieNight_WithAProjector]: "Outdoor Movie Night (With a Projector)",
|
|
523
|
-
[BashEventType.Parade]: "Parade",
|
|
524
|
-
[BashEventType.Party]: "Party",
|
|
525
|
-
[BashEventType.PoolParty]: "Pool Party",
|
|
526
|
-
[BashEventType.Potluck]: "Potluck",
|
|
527
|
-
[BashEventType.PotluckVegan]: "Potluck (Vegan)",
|
|
528
|
-
[BashEventType.PreParty]: "Pre-Party",
|
|
529
|
-
[BashEventType.ProductLaunch]: "Product Launch",
|
|
530
|
-
[BashEventType.ProfessionalNetworkingEvent]: "Professional Networking Event",
|
|
531
|
-
[BashEventType.Rave_General]: "Rave (General)",
|
|
532
|
-
[BashEventType.RetirementCelebration]: "Retirement Celebration",
|
|
533
|
-
[BashEventType.Reunion_FamilyOrSchoolOrFriends]: "Reunion (Family/School/Friends)",
|
|
534
|
-
[BashEventType.SafariAdventureParty]: "Safari Adventure Party",
|
|
535
|
-
[BashEventType.SchoolEvent_MiddleSchoolOrHighSchoolOrCollege]: "School Event (MiddleSchool, High School, College)",
|
|
536
|
-
[BashEventType.ScienceFictionThemedParty]: "Science Fiction-Themed Party",
|
|
537
|
-
[BashEventType.SocialClubEvent]: "Social Club Event",
|
|
538
|
-
[BashEventType.SportsTournament]: "Sports Tournament",
|
|
539
|
-
[BashEventType.SportsWatchParty]: "Sports Watch Party",
|
|
540
|
-
[BashEventType.SuperheroThemedParty]: "Superhero Themed Party",
|
|
541
|
-
[BashEventType.SurfCompetition]: "Surf Competition",
|
|
542
|
-
[BashEventType.ThanksgivingDinner]: "Thanksgiving Dinner",
|
|
543
|
-
[BashEventType.ThemedCostumeParty]: "Themed Costume Party",
|
|
544
|
-
[BashEventType.ThemedDinnerParty]: "Themed Dinner Party",
|
|
545
|
-
[BashEventType.ThemedPubCrawl]: "Themed Pub Crawl",
|
|
546
|
-
[BashEventType.Tournament]: "Tournament",
|
|
547
|
-
[BashEventType.TravelAndTradeShow]: "Travel and Trade Show",
|
|
548
|
-
[BashEventType.TriviaNight]: "Trivia Night",
|
|
549
|
-
[BashEventType.ValentinesDayParty]: "Valentine's Day Party",
|
|
550
|
-
[BashEventType.WeddingReception]: "Wedding Reception",
|
|
551
|
-
[BashEventType.WelcomeHomeParty]: "Welcome Home Party",
|
|
552
|
-
[BashEventType.WellnessFestival]: "Wellness Festival",
|
|
553
|
-
[BashEventType.WineTastingEvent]: "Wine Tasting Event",
|
|
554
|
-
[BashEventType.Other]: "Other",
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
export type RecordKey = string | number | symbol;
|
|
558
|
-
export type PartialExcept<T, K extends keyof T> = Partial<T> & {[P in K]: T[P]};
|
|
559
|
-
type GetTypeOfArray<T> = T extends (infer U)[] ? U : never;
|
|
560
|
-
|
|
561
|
-
export type AllKeysUnionOfDescendants<T> = T extends object
|
|
562
|
-
? T[keyof T] extends infer K
|
|
563
|
-
? K extends string | number | symbol
|
|
564
|
-
? {[K in keyof T]-?: T[K] extends any[]
|
|
565
|
-
? GetTypeOfArray<T[K]> extends Record<RecordKey, any>
|
|
566
|
-
? `${K & string}` | `${AllKeysUnion<GetTypeOfArray<T[K]>>}`
|
|
567
|
-
: never
|
|
568
|
-
: `${K & string}` | `${AllKeysUnion<T[K]>}`}[keyof T]
|
|
569
|
-
: never
|
|
570
|
-
: never
|
|
571
|
-
: never;
|
|
572
|
-
|
|
573
|
-
export type AllKeysOfDescendants<T> = AllKeysUnionOfDescendants<T>[];
|
|
574
|
-
|
|
575
|
-
type AllKeysUnion<T> = T extends object
|
|
576
|
-
? T[keyof T] extends infer K
|
|
577
|
-
? K extends string | number | symbol
|
|
578
|
-
? {[K in keyof T]-?: T[K] extends any[]
|
|
579
|
-
? GetTypeOfArray<T[K]> extends Record<RecordKey, any>
|
|
580
|
-
? `${K & string}` | `${K & string}${typeof URL_INCLUDE_PRISMA_DATA_KEYS_DELIM}${AllKeysUnion<GetTypeOfArray<T[K]>> & string}`
|
|
581
|
-
: never
|
|
582
|
-
: T[K] extends Function
|
|
583
|
-
? never
|
|
584
|
-
: `${K & string}` | `${K & string}${typeof URL_INCLUDE_PRISMA_DATA_KEYS_DELIM}${AllKeysUnion<T[K]> & string}`}[keyof T]
|
|
585
|
-
: never
|
|
586
|
-
: never
|
|
587
|
-
: never;
|
|
588
|
-
|
|
589
|
-
export type AllKeys<T> = AllKeysUnion<T>[];
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
export interface IAddress {
|
|
593
|
-
place?: string;
|
|
594
|
-
googlePlaceId?: string;
|
|
595
|
-
street: string;
|
|
596
|
-
city: string;
|
|
597
|
-
state: string;
|
|
598
|
-
zipCode: string;
|
|
599
|
-
country: string;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
export interface SocialMediaProfile {
|
|
604
|
-
id: string;
|
|
605
|
-
platform: string; // Enum type if available
|
|
606
|
-
url: string;
|
|
607
|
-
userId: string;
|
|
608
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
BashEventDressTags,
|
|
3
|
+
BashEventType,
|
|
4
|
+
BashEventVibeTags,
|
|
5
|
+
Contact,
|
|
6
|
+
DayOfWeek,
|
|
7
|
+
Prisma,
|
|
8
|
+
// Rate,
|
|
9
|
+
ServiceTypes,
|
|
10
|
+
Ticket,
|
|
11
|
+
TicketTier,
|
|
12
|
+
User,
|
|
13
|
+
YearsOfExperience
|
|
14
|
+
} from "@prisma/client";
|
|
15
|
+
import { ServiceExt, CheckoutExt, PublicUser, VolunteerServiceExt, BashEventExt} from "./extendedSchemas";
|
|
16
|
+
|
|
17
|
+
export const PASSWORD_MIN_LENGTH = 8 as const;
|
|
18
|
+
export const PASSWORD_REQUIREMENTS_REGEX = new RegExp(String.raw`^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&^#])[A-Za-z\d@$!%*?&^#]{${PASSWORD_MIN_LENGTH},}$`);
|
|
19
|
+
export const BASH_FEE_PERCENTAGE = 0.10;
|
|
20
|
+
export const GOOGLE_CALLBACK_URL = '/auth/google/callback' as const;
|
|
21
|
+
export const CHECKOUT_RETURN_SUCCESS_URL = `/checkout-return/success/{CHECKOUT_SESSION_ID}` as const;
|
|
22
|
+
export const CHECKOUT_RETURN_CANCEL_URL = `/checkout-return/cancel/{CHECKOUT_SESSION_ID}` as const;
|
|
23
|
+
export const CHECKOUT_RETURN_SUCCESS_URL_PAGE = '/checkout-return/success/$checkoutSessionId' as const;
|
|
24
|
+
export const CHECKOUT_RETURN_CANCEL_URL_PAGE = '/checkout-return/cancel/$checkoutSessionId' as const;
|
|
25
|
+
export const DONATION_CHECKOUT_RETURN_SUCCESS_URL = `/donation-checkout-return/success/{CHECKOUT_SESSION_ID}` as const;
|
|
26
|
+
export const DONATION_CHECKOUT_RETURN_CANCEL_URL = `/donation-checkout-return/cancel/{CHECKOUT_SESSION_ID}` as const;
|
|
27
|
+
export const DONATION_CHECKOUT_RETURN_SUCCESS_URL_PAGE = '/donation-checkout-return/success/$checkoutSessionId' as const;
|
|
28
|
+
export const DONATION_CHECKOUT_RETURN_CANCEL_URL_PAGE = '/donation-checkout-return/cancel/$checkoutSessionId' as const;
|
|
29
|
+
export const VERIFICATION_RETURN_URL = `/sign-up` as const;
|
|
30
|
+
export const BASH_DETAIL_URL = `/bash-detail` as const;
|
|
31
|
+
export const SERVICE_PAGE_URL = `/service-page` as const;
|
|
32
|
+
export const LOGIN_URL = `/login` as const;
|
|
33
|
+
export const TICKET_DETAILS = `/ticket-details` as const;
|
|
34
|
+
|
|
35
|
+
export const SWR_KEY_AUTH_TOKEN = "auth-token" as const;
|
|
36
|
+
|
|
37
|
+
export const PRICE_DOLLARS_AND_CENTS_RATIO = 100 as const;
|
|
38
|
+
|
|
39
|
+
export const MIN_AMOUNT_OF_TICKETS_FOR_PUBLIC_EVENT_TO_SHOW = 0 as const;
|
|
40
|
+
export const DEFAULT_MAX_NUMBER_OF_TICKETS = 35 as const
|
|
41
|
+
export const MIN_NUMBER_OF_TICKETS = 0 as const;
|
|
42
|
+
|
|
43
|
+
export const MAX_NUMBER_OF_FREE_TICKETS_PER_USER_FOR_A_BASH_EVENT = 100 as const;
|
|
44
|
+
export const MAX_NUMBER_OF_TICKETS_PER_REQUEST_FOR_A_BASH_EVENT = 50 as const;
|
|
45
|
+
|
|
46
|
+
export const MONTHS_PREVIOUS_THAT_STRIPE_ACCOUNTS_WILL_BE_SEARCHED_BY_EMAIL = 1 as const;
|
|
47
|
+
|
|
48
|
+
export const HTTP_CODE_OK = 200 as const;
|
|
49
|
+
export const HTTP_CODE_TEMPORARY_REDIRECT = 307 as const;
|
|
50
|
+
export const HTTP_CODE_INTERNAL_SERVER_ERR = 500 as const
|
|
51
|
+
export const HTTP_CODE_BAD_REQUEST = 400 as const;
|
|
52
|
+
export const HTTP_CODE_UNAUTHORIZED = 401 as const;
|
|
53
|
+
export const HTTP_CODE_NOT_FOUND = 404 as const;
|
|
54
|
+
export const ERR_UNAUTHORIZED_REQUEST = "Unauthorized to perform requested action. Have you logged in?" as const;
|
|
55
|
+
|
|
56
|
+
export const URL_PARAMS_BASH_EVENT_ID = 'bashEventId' as const;
|
|
57
|
+
export const URL_PARAMS_BASH_EVENT_TITLE = 'bashEventTitle' as const;
|
|
58
|
+
export const URL_PARAMS_BASH_EVENT_DESC = 'bashEventDesc' as const;
|
|
59
|
+
export const URL_PARAMS_BASH_EVENT_COVER_PHOTO = 'bashEventCoverPhoto' as const;
|
|
60
|
+
export const URL_PARAMS_EMAIL = 'email' as const;
|
|
61
|
+
export const URL_PARAMS_OTP_CODE = 'code' as const;
|
|
62
|
+
export const URL_PARAMS_INCLUDE = 'include' as const;
|
|
63
|
+
export const URL_PARAMS_REDIRECT = 'redirect' as const;
|
|
64
|
+
export const URL_PARAMS_GOOGLE_ACCESS_CODE = 'code' as const;
|
|
65
|
+
export const URL_PARAMS_LINKED_IN_CODE = 'code' as const;
|
|
66
|
+
export const URL_PARAMS_STATE = 'state' as const;
|
|
67
|
+
|
|
68
|
+
export const URL_PARAMS_TICKET_LIST_DELIM = ',' as const;
|
|
69
|
+
export const URL_PARAMS_TICKET_TIER_ID_NUMBER_OF_TICKETS_DATE_DELIM = '__' as const
|
|
70
|
+
export const URL_PARAMS_NUMBER_OF_TICKETS_TICKETS_DATE_DELIM = '~~' as const
|
|
71
|
+
export const URL_PARAMS_TICKETS_DATE_DELIM = ';;' as const
|
|
72
|
+
|
|
73
|
+
export const URL_INCLUDE_QUERY_PARAM_DELIM = ',' as const;
|
|
74
|
+
export const URL_INCLUDE_PRISMA_DATA_KEYS_DELIM = '.' as const;
|
|
75
|
+
|
|
76
|
+
export const DEFAULT_PRISMA_TTL_SECONDS = 60 as const;
|
|
77
|
+
export const PRISMA_MEDIA_TTL_SECONDS = 60 * 5; // 5 hours
|
|
78
|
+
export const PRISMA_USER_TTL_SECONDS = 60 * 7; // 7 hours
|
|
79
|
+
export const PRISMA_BASH_EVENT_TTL_SECONDS = 60 as const;
|
|
80
|
+
export const PRISMA_SERVICE_TTL_SECONDS = 60 as const;
|
|
81
|
+
|
|
82
|
+
export const DEBOUNCE_WAIT = 1000 as const;
|
|
83
|
+
|
|
84
|
+
export const ASSET_KEY_DELIM = '__' as const;
|
|
85
|
+
export const ASSET_MAX_MD5_BYTE_LENGTH = 1024 * 100; // 100kb
|
|
86
|
+
|
|
87
|
+
export const MIN_NUMBER_OF_HOURS = 1;
|
|
88
|
+
export const DEFAULT_MAX_NUMBER_OF_HOURS = 24;
|
|
89
|
+
|
|
90
|
+
export const SERVICE_LINK_DATA_TO_INCLUDE = {
|
|
91
|
+
link: true,
|
|
92
|
+
} satisfies Prisma.ServiceLinkInclude;
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
// export type ServiceSpecificName = keyof Pick<
|
|
96
|
+
// ServiceExt,
|
|
97
|
+
// "eventService" |
|
|
98
|
+
// "entertainmentService" |
|
|
99
|
+
// "vendor" |
|
|
100
|
+
// "exhibitor" |
|
|
101
|
+
// "sponsor" |
|
|
102
|
+
// "venue" |
|
|
103
|
+
// "organization"
|
|
104
|
+
// >;
|
|
105
|
+
|
|
106
|
+
export const VENUE_DATA_TO_INCLUDE = {
|
|
107
|
+
|
|
108
|
+
} satisfies Prisma.VenueInclude;
|
|
109
|
+
|
|
110
|
+
export const VENDOR_DATA_TO_INCLUDE = {
|
|
111
|
+
crowdSize: true,
|
|
112
|
+
} satisfies Prisma.VendorInclude;
|
|
113
|
+
|
|
114
|
+
export const VOLUNTEER_DATA_TO_INCLUDE = {
|
|
115
|
+
links: {
|
|
116
|
+
include: {
|
|
117
|
+
serviceLinks: true,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
media: true,
|
|
121
|
+
serviceRange: true,
|
|
122
|
+
} satisfies Prisma.VolunteerServiceInclude;
|
|
123
|
+
|
|
124
|
+
export type DateTimeArgType = Date | string | undefined | null;
|
|
125
|
+
export type RequiredStripeInfoMissingErrorDataType = { [k in keyof User]?: { type: string, label: string } };
|
|
126
|
+
export type ContactOrUser = Contact | PublicUser;
|
|
127
|
+
|
|
128
|
+
export type UnionFromArray<T extends ReadonlyArray<any>> = T[number];
|
|
129
|
+
export type ValueOf<T> = T[keyof T];
|
|
130
|
+
|
|
131
|
+
export type FilterFields = {
|
|
132
|
+
price: string[];
|
|
133
|
+
ageRequirement: string[];
|
|
134
|
+
allowed: string[];
|
|
135
|
+
notAllowed: string[];
|
|
136
|
+
crowd: string[];
|
|
137
|
+
vibe: string[];
|
|
138
|
+
included: string[];
|
|
139
|
+
hostRating: string[];
|
|
140
|
+
specialOffers: string[];
|
|
141
|
+
eventFormat: string[];
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export type TicketTierWherePriceIsAString = Omit<TicketTier, 'price'> & {price: string} & {cannotDelete: boolean};
|
|
145
|
+
|
|
146
|
+
export interface DeletedAndHiddenTiers {
|
|
147
|
+
deletedTiers: TicketTier[];
|
|
148
|
+
hiddenTiers: TicketTier[];
|
|
149
|
+
errorType?: ApiErrorType;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface AttendeeOfBashEvent {
|
|
153
|
+
user: PublicUser;
|
|
154
|
+
tickets: Ticket[];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface FirstFewAttendingBashEvent {
|
|
158
|
+
checkouts: CheckoutExt[];
|
|
159
|
+
totalTicketCount: number;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface SignInEmailWithCode {
|
|
163
|
+
email: string;
|
|
164
|
+
code: string;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface MoreOptionsMenuItem {
|
|
168
|
+
name: string;
|
|
169
|
+
href?: string;
|
|
170
|
+
onClick?: () => void;
|
|
171
|
+
icon?: React.ElementType;
|
|
172
|
+
items: MoreOptionsMenuItem[];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface LinkedInAuthData {
|
|
176
|
+
accessToken: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface NumberOfTicketsForDate {
|
|
180
|
+
numberOfTickets: number;
|
|
181
|
+
ticketDateTime: DateTimeArgType;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface AvailableTicketsForTicketTier {
|
|
185
|
+
ticketTier: TicketTier;
|
|
186
|
+
availableTickets: NumberOfTicketsForDate[];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface AvailableTicketsForTicketTierForDate {
|
|
190
|
+
ticketTier: TicketTier,
|
|
191
|
+
availableTicketsForDate: NumberOfTicketsForDate;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface AvailableTicketsForTicketTier {
|
|
195
|
+
ticketTier: TicketTier;
|
|
196
|
+
availableTickets: NumberOfTicketsForDate[];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface NumberOfHoursForDate {
|
|
200
|
+
numberOfHours: number;
|
|
201
|
+
bookingDateTime: DateTimeArgType;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// export interface AvailableNumberOfHoursForRate {
|
|
205
|
+
// rate: Rate;
|
|
206
|
+
// availableHours: NumberOfHoursForDate[];
|
|
207
|
+
// }
|
|
208
|
+
|
|
209
|
+
// export interface AvailableHoursForRateForDate {
|
|
210
|
+
// rate: Rate,
|
|
211
|
+
// availableHoursForDate: NumberOfHoursForDate;
|
|
212
|
+
// }
|
|
213
|
+
|
|
214
|
+
// export interface AvailableHoursForRate {
|
|
215
|
+
// rate: Rate;
|
|
216
|
+
// availableHours: NumberOfHoursForDate[];
|
|
217
|
+
// }
|
|
218
|
+
|
|
219
|
+
// export interface DeletedAndHiddenRates {
|
|
220
|
+
// deletedRates: Rate[];
|
|
221
|
+
// hiddenRates: Rate[];
|
|
222
|
+
// errorType?: ApiErrorType;
|
|
223
|
+
// }
|
|
224
|
+
|
|
225
|
+
export interface SignInEmailWithPassword {
|
|
226
|
+
email: string;
|
|
227
|
+
password: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export interface ForgotPassword {
|
|
231
|
+
email: string;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export interface ResetPassword {
|
|
235
|
+
email: string;
|
|
236
|
+
password: string;
|
|
237
|
+
otp: string;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export interface ApiResult<T, P extends ErrorDataType = ErrorDataType> {
|
|
241
|
+
data?: T;
|
|
242
|
+
status?: number;
|
|
243
|
+
token?: string;
|
|
244
|
+
error?: string;
|
|
245
|
+
errorType?: ApiErrorType;
|
|
246
|
+
errorData?: P;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export enum ApiErrorType {
|
|
250
|
+
Unknown = 1,
|
|
251
|
+
UserAlreadyHasMaximumAllowedFreeTicketsForBashEvent,
|
|
252
|
+
BashHasNoMoreTicketsAvailable,
|
|
253
|
+
NotEnoughTicketsAvailable,
|
|
254
|
+
UserExceededMaxTicketNumberForOneRequest,
|
|
255
|
+
UserDoesNotExist,
|
|
256
|
+
StripeCreateCheckoutSessionFailed,
|
|
257
|
+
StripeUserInfoIncomplete,
|
|
258
|
+
TicketsAlreadyPurchasedUsingThisCheckoutSession,
|
|
259
|
+
StripeAccountHasNotSetupTaxData,
|
|
260
|
+
StripeCheckoutSessionIncomplete,
|
|
261
|
+
CouldNotSendEmail,
|
|
262
|
+
TicketTierHiddenAsAtLeastOneTicketHasAlreadyBeenPurchased,
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export type ErrorDataType = Record<RecordKey, any>;
|
|
266
|
+
|
|
267
|
+
export const StripeErrorToApiErrorType = {
|
|
268
|
+
"stripe_tax_inactive": ApiErrorType.StripeAccountHasNotSetupTaxData
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export interface StripeCreateBashEventTicketsCheckoutSessionArgs {
|
|
272
|
+
bashEventId: string;
|
|
273
|
+
currency: string;
|
|
274
|
+
paymentMethodType: string;
|
|
275
|
+
ticketListStr: string;
|
|
276
|
+
promoCode?: string;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export interface StripeCreateBashEventDonationCheckoutSessionArgs {
|
|
280
|
+
bashEventId: string;
|
|
281
|
+
currency: string;
|
|
282
|
+
paymentMethodType: string;
|
|
283
|
+
donationAmount: number;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export interface StripeCreateServiceSubscriptionCheckoutSessionArgs {
|
|
287
|
+
serviceId: string;
|
|
288
|
+
currency: string;
|
|
289
|
+
paymentMethodType: string;
|
|
290
|
+
promoCode?: string;
|
|
291
|
+
successUrl: string;
|
|
292
|
+
cancelUrl: string;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface StripeCreateAccountPortalSessionArgs {
|
|
296
|
+
stripeAccountId: string;
|
|
297
|
+
returnUrl: string;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export type StripeSessionRedirect = {
|
|
301
|
+
stripeAccountIdDB: string;
|
|
302
|
+
redirectUrl: string;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// export type ServiceStripeSessionRedirect = {
|
|
306
|
+
// service: ServiceExt;
|
|
307
|
+
// } & StripeSessionRedirect;
|
|
308
|
+
|
|
309
|
+
// export type BashEventStripeSessionRedirect = {
|
|
310
|
+
// bashEvent: BashEventExt;
|
|
311
|
+
// } & StripeSessionRedirect;
|
|
312
|
+
|
|
313
|
+
// export type StripeLinkingStatus = "Complete" | "Incomplete";
|
|
314
|
+
|
|
315
|
+
export type StripeAddress = {
|
|
316
|
+
line1: string;
|
|
317
|
+
line2: string;
|
|
318
|
+
city: string;
|
|
319
|
+
state: string;
|
|
320
|
+
zipCode: string;
|
|
321
|
+
country: string;
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
export type StripeLinkingStatus = {
|
|
325
|
+
isOnboarded: boolean;
|
|
326
|
+
hasOutstandingRequirements: boolean;
|
|
327
|
+
paymentsEnabled: boolean;
|
|
328
|
+
taxMonitoringEnabled: boolean;
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
export type StripeBusinessDataPublic = {
|
|
332
|
+
logoUrl?: string; //not possible to fetch logo directly from stripe
|
|
333
|
+
businessName?: string;
|
|
334
|
+
businessNameDBA?: string;
|
|
335
|
+
supportEmail?: string;
|
|
336
|
+
supportPhone?: string;
|
|
337
|
+
supportURL?: string;
|
|
338
|
+
address?: StripeAddress;
|
|
339
|
+
accountType: string;
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
export type StripeBusinessDataOwned = {
|
|
343
|
+
stripeAccountDBId: string;
|
|
344
|
+
|
|
345
|
+
bankAccount?: string;
|
|
346
|
+
linkingStatus: StripeLinkingStatus;
|
|
347
|
+
|
|
348
|
+
createdDate: string;
|
|
349
|
+
updatedDate: string;
|
|
350
|
+
} & StripeBusinessDataPublic;
|
|
351
|
+
|
|
352
|
+
export interface StripeConfirmPayment {
|
|
353
|
+
checkoutSessionId: string;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export interface StripeAccountLinkArgs {
|
|
357
|
+
userId?: string;
|
|
358
|
+
returnUrl: string;
|
|
359
|
+
refreshUrl: string;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export interface StripeBusinessLinkArgs {
|
|
363
|
+
businessId: string;
|
|
364
|
+
returnUrl: string;
|
|
365
|
+
refreshUrl: string;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export interface StripeConfirmPaymentResult {
|
|
369
|
+
bashEventId: string;
|
|
370
|
+
numberOfTickets: number;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export interface IMediaUploadArgs {
|
|
374
|
+
mimetype: string;
|
|
375
|
+
idOfLinkedPrismaEntry: string;
|
|
376
|
+
assetKey: string;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export interface IPreSignedUrlArgs {
|
|
380
|
+
assetKey: string;
|
|
381
|
+
mimetype: string;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export interface IPreSignedUrlResult {
|
|
385
|
+
assetKey: string;
|
|
386
|
+
preSignedUrl: string | undefined;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export const ASSET_MIME_TYPES_TO_EXT = {
|
|
390
|
+
'image/jpeg': '.jpeg',
|
|
391
|
+
'image/png': '.png',
|
|
392
|
+
'image/gif': '.gif',
|
|
393
|
+
'image/bmp': '.bmp',
|
|
394
|
+
'image/webp': '.webp',
|
|
395
|
+
'image/svg+xml': '.svg',
|
|
396
|
+
'image/tiff': '.tiff',
|
|
397
|
+
'image/vnd': '.ico',
|
|
398
|
+
'video/mp4': '.mp4',
|
|
399
|
+
// '.webm',
|
|
400
|
+
// '.ogg',
|
|
401
|
+
// '.avi',
|
|
402
|
+
// '.mov',
|
|
403
|
+
// '.mkv'
|
|
404
|
+
};
|
|
405
|
+
export const VALID_ASSET_MIME_TYPES = Object.keys(ASSET_MIME_TYPES_TO_EXT);
|
|
406
|
+
|
|
407
|
+
export const VibeTagsToString: { [key in BashEventVibeTags]: string } = {
|
|
408
|
+
[BashEventVibeTags.Wild]: "Wild",
|
|
409
|
+
[BashEventVibeTags.Calm]: "Chill",
|
|
410
|
+
}
|
|
411
|
+
export const DressTagsToString: { [key in BashEventDressTags]: string } = {
|
|
412
|
+
[BashEventDressTags.Casual]: "Casual",
|
|
413
|
+
[BashEventDressTags.BusinessCasual]: "Business casual",
|
|
414
|
+
[BashEventDressTags.Formal]: "Formal"
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// export const ServicesTagsToString: { [key in ServicesTags]: string } = {
|
|
418
|
+
// [ServicesTags.Fast]: "Fast",
|
|
419
|
+
// [ServicesTags.Reliable]: "Reliable",
|
|
420
|
+
// [ServicesTags.AwardRecipient]: "Award recipient"
|
|
421
|
+
// }
|
|
422
|
+
|
|
423
|
+
export const DayOfWeekToString: { [key in DayOfWeek]: string } = {
|
|
424
|
+
[DayOfWeek.Sunday]: 'S',
|
|
425
|
+
[DayOfWeek.Monday]: 'M',
|
|
426
|
+
[DayOfWeek.Tuesday]: 'T',
|
|
427
|
+
[DayOfWeek.Wednesday]: 'W',
|
|
428
|
+
[DayOfWeek.Thursday]: 'T',
|
|
429
|
+
[DayOfWeek.Friday]: 'F',
|
|
430
|
+
[DayOfWeek.Saturday]: 'S',
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
export const YearsOfExperienceToString: { [key in YearsOfExperience]: string } = {
|
|
435
|
+
[YearsOfExperience.LessThanOneYear]: 'Less than one year',
|
|
436
|
+
[YearsOfExperience.OneToThreeYears]: 'One to three years',
|
|
437
|
+
[YearsOfExperience.ThreeToFiveYears]: 'Three to five years',
|
|
438
|
+
[YearsOfExperience.FivePlusYears]: 'More than five years',
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
export type BashEventTypeToStringType = {
|
|
442
|
+
[key in BashEventType]: string;
|
|
443
|
+
};
|
|
444
|
+
export const BashEventTypeToString: BashEventTypeToStringType = {
|
|
445
|
+
[BashEventType.AfterParty]: "After-Party",
|
|
446
|
+
[BashEventType.AnimeAndCosplayFestival]: "Anime and Cosplay Festival",
|
|
447
|
+
[BashEventType.AnniversaryCelebration]: "Anniversary Celebration",
|
|
448
|
+
[BashEventType.ArtExhibitOpening]: "Art Exhibit Opening",
|
|
449
|
+
[BashEventType.ArtAndCraftNight]: "Art and Craft Night",
|
|
450
|
+
[BashEventType.BBQCookout]: "BBQ Cookout",
|
|
451
|
+
[BashEventType.BabyShower]: "Baby Shower",
|
|
452
|
+
[BashEventType.BachelorOrBacheloretteParty]: "Bachelor/Bachelorette Party",
|
|
453
|
+
[BashEventType.BeachParty]: "Beach Party",
|
|
454
|
+
[BashEventType.Birthday]: "Birthday",
|
|
455
|
+
[BashEventType.BoatPartyOrCruise]: "Boat Party or Cruise",
|
|
456
|
+
[BashEventType.Bonfire]: "Bonfire",
|
|
457
|
+
[BashEventType.BookClubMeeting]: "Book Club Meeting",
|
|
458
|
+
[BashEventType.BridalShower]: "Bridal Shower",
|
|
459
|
+
[BashEventType.BrunchGathering]: "Brunch Gathering",
|
|
460
|
+
[BashEventType.CarShow]: "Car Show",
|
|
461
|
+
[BashEventType.CarnivalAndFair]: "Carnival and Fair",
|
|
462
|
+
[BashEventType.CasinoNight]: "Casino Night",
|
|
463
|
+
[BashEventType.CasualMixer]: "Casual Mixer",
|
|
464
|
+
[BashEventType.CharityBall]: "Charity Ball",
|
|
465
|
+
[BashEventType.CharityFundraiser]: "Charity Fundraiser",
|
|
466
|
+
[BashEventType.ChristmasParty]: "Christmas Party",
|
|
467
|
+
[BashEventType.ChurchEvent]: "Church Event",
|
|
468
|
+
[BashEventType.CircusOrCarnivalParty]: "Circus/Carnival Party",
|
|
469
|
+
[BashEventType.CocktailParty]: "Cocktail Party",
|
|
470
|
+
[BashEventType.CollegeParty_FraternityOrSorority]: "College Party (Fraternity/Sorority)",
|
|
471
|
+
[BashEventType.ComedyShowOrStandUpComedyNight]: "Comedy Show Or Stand-Up Comedy Night",
|
|
472
|
+
[BashEventType.ComicConvention]: "Comic Convention",
|
|
473
|
+
[BashEventType.Competition]: "Competition",
|
|
474
|
+
[BashEventType.Concert]: "Concert",
|
|
475
|
+
[BashEventType.CookingCompetition]: "Cooking Competition",
|
|
476
|
+
[BashEventType.CorporateEventOrOfficeParty]: "Corporate Event/Office Party",
|
|
477
|
+
[BashEventType.CostumeParty_Theme_Based]: "Costume Party (Theme-Based)",
|
|
478
|
+
[BashEventType.CulturalFestival]: "Cultural Festival",
|
|
479
|
+
[BashEventType.DanceParty]: "Dance Party",
|
|
480
|
+
[BashEventType.DesertRave]: "Desert Rave",
|
|
481
|
+
[BashEventType.DiscoNight]: "Disco Night",
|
|
482
|
+
[BashEventType.EasterGathering]: "Easter Gathering",
|
|
483
|
+
[BashEventType.EngagementParty]: "Engagement Party",
|
|
484
|
+
[BashEventType.ESportsGamingTournament]: "E-sports Gaming Tournament",
|
|
485
|
+
[BashEventType.ExclusiveLuxuryRetreat]: "Exclusive Luxury Retreat",
|
|
486
|
+
[BashEventType.FantasyThemedParty]: "Fantasy Themed Party",
|
|
487
|
+
[BashEventType.FashionShow]: "Fashion Show",
|
|
488
|
+
[BashEventType.Fireside]: "Fireside",
|
|
489
|
+
[BashEventType.FitnessFestival]: "Fitness Festival",
|
|
490
|
+
[BashEventType.FlashMob]: "Flash Mob",
|
|
491
|
+
[BashEventType.Festival]: "Festival",
|
|
492
|
+
[BashEventType.FestivalFilm]: "Film Festival",
|
|
493
|
+
[BashEventType.FestivalFood]: "Food Festival",
|
|
494
|
+
[BashEventType.FundraisingEvent]: "Fundraising Event",
|
|
495
|
+
[BashEventType.GalaDinner]: "Gala Dinner",
|
|
496
|
+
[BashEventType.GameNight]: "Game Night",
|
|
497
|
+
[BashEventType.GamingEvent]: "Gaming Event",
|
|
498
|
+
[BashEventType.GardenParty]: "Garden Party",
|
|
499
|
+
[BashEventType.GoingAwayPartyOrFarewell]: "Going-away Party or Farewell",
|
|
500
|
+
[BashEventType.GraduationParty]: "Graduation Party",
|
|
501
|
+
[BashEventType.HalloweenCostumeParty]: "Halloween Costume Party",
|
|
502
|
+
[BashEventType.HanukkahParty]: "Hanukkah Party",
|
|
503
|
+
[BashEventType.HistoricalEraParty]: "Historical Era Party",
|
|
504
|
+
[BashEventType.HolidayParty]: "Holiday Party",
|
|
505
|
+
[BashEventType.HouseParty]: "House Party",
|
|
506
|
+
[BashEventType.HousewarmingParty]: "Housewarming Party",
|
|
507
|
+
[BashEventType.KaraokeNight]: "Karaoke Night",
|
|
508
|
+
[BashEventType.KiteFlyingFestival]: "Kite Flying Festival",
|
|
509
|
+
[BashEventType.LiveBandPerformanceInALocalVenue]: "Live Band Performance in a Local Venue",
|
|
510
|
+
[BashEventType.Luau]: "Luau",
|
|
511
|
+
[BashEventType.MansionParty]: "Mansion Party",
|
|
512
|
+
[BashEventType.MardiGras]: "Mardi Gras",
|
|
513
|
+
[BashEventType.MasqueradeBall]: "Masquerade Ball",
|
|
514
|
+
[BashEventType.MotorcycleRally]: "Motorcycle Rally",
|
|
515
|
+
[BashEventType.MovieNight]: "Movie Night",
|
|
516
|
+
[BashEventType.MoviePremiere]: "Movie Premiere",
|
|
517
|
+
[BashEventType.MusicFestival]: "Music Festival",
|
|
518
|
+
[BashEventType.NewYearsEveCelebration]: "New Year's Eve Celebration",
|
|
519
|
+
[BashEventType.OpenMicNight]: "Open Mic Night",
|
|
520
|
+
[BashEventType.OutdoorActivity]: "Outdoor Activity",
|
|
521
|
+
[BashEventType.OutdoorConcert]: "Outdoor Concert",
|
|
522
|
+
[BashEventType.OutdoorMovieNight_WithAProjector]: "Outdoor Movie Night (With a Projector)",
|
|
523
|
+
[BashEventType.Parade]: "Parade",
|
|
524
|
+
[BashEventType.Party]: "Party",
|
|
525
|
+
[BashEventType.PoolParty]: "Pool Party",
|
|
526
|
+
[BashEventType.Potluck]: "Potluck",
|
|
527
|
+
[BashEventType.PotluckVegan]: "Potluck (Vegan)",
|
|
528
|
+
[BashEventType.PreParty]: "Pre-Party",
|
|
529
|
+
[BashEventType.ProductLaunch]: "Product Launch",
|
|
530
|
+
[BashEventType.ProfessionalNetworkingEvent]: "Professional Networking Event",
|
|
531
|
+
[BashEventType.Rave_General]: "Rave (General)",
|
|
532
|
+
[BashEventType.RetirementCelebration]: "Retirement Celebration",
|
|
533
|
+
[BashEventType.Reunion_FamilyOrSchoolOrFriends]: "Reunion (Family/School/Friends)",
|
|
534
|
+
[BashEventType.SafariAdventureParty]: "Safari Adventure Party",
|
|
535
|
+
[BashEventType.SchoolEvent_MiddleSchoolOrHighSchoolOrCollege]: "School Event (MiddleSchool, High School, College)",
|
|
536
|
+
[BashEventType.ScienceFictionThemedParty]: "Science Fiction-Themed Party",
|
|
537
|
+
[BashEventType.SocialClubEvent]: "Social Club Event",
|
|
538
|
+
[BashEventType.SportsTournament]: "Sports Tournament",
|
|
539
|
+
[BashEventType.SportsWatchParty]: "Sports Watch Party",
|
|
540
|
+
[BashEventType.SuperheroThemedParty]: "Superhero Themed Party",
|
|
541
|
+
[BashEventType.SurfCompetition]: "Surf Competition",
|
|
542
|
+
[BashEventType.ThanksgivingDinner]: "Thanksgiving Dinner",
|
|
543
|
+
[BashEventType.ThemedCostumeParty]: "Themed Costume Party",
|
|
544
|
+
[BashEventType.ThemedDinnerParty]: "Themed Dinner Party",
|
|
545
|
+
[BashEventType.ThemedPubCrawl]: "Themed Pub Crawl",
|
|
546
|
+
[BashEventType.Tournament]: "Tournament",
|
|
547
|
+
[BashEventType.TravelAndTradeShow]: "Travel and Trade Show",
|
|
548
|
+
[BashEventType.TriviaNight]: "Trivia Night",
|
|
549
|
+
[BashEventType.ValentinesDayParty]: "Valentine's Day Party",
|
|
550
|
+
[BashEventType.WeddingReception]: "Wedding Reception",
|
|
551
|
+
[BashEventType.WelcomeHomeParty]: "Welcome Home Party",
|
|
552
|
+
[BashEventType.WellnessFestival]: "Wellness Festival",
|
|
553
|
+
[BashEventType.WineTastingEvent]: "Wine Tasting Event",
|
|
554
|
+
[BashEventType.Other]: "Other",
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
export type RecordKey = string | number | symbol;
|
|
558
|
+
export type PartialExcept<T, K extends keyof T> = Partial<T> & {[P in K]: T[P]};
|
|
559
|
+
type GetTypeOfArray<T> = T extends (infer U)[] ? U : never;
|
|
560
|
+
|
|
561
|
+
export type AllKeysUnionOfDescendants<T> = T extends object
|
|
562
|
+
? T[keyof T] extends infer K
|
|
563
|
+
? K extends string | number | symbol
|
|
564
|
+
? {[K in keyof T]-?: T[K] extends any[]
|
|
565
|
+
? GetTypeOfArray<T[K]> extends Record<RecordKey, any>
|
|
566
|
+
? `${K & string}` | `${AllKeysUnion<GetTypeOfArray<T[K]>>}`
|
|
567
|
+
: never
|
|
568
|
+
: `${K & string}` | `${AllKeysUnion<T[K]>}`}[keyof T]
|
|
569
|
+
: never
|
|
570
|
+
: never
|
|
571
|
+
: never;
|
|
572
|
+
|
|
573
|
+
export type AllKeysOfDescendants<T> = AllKeysUnionOfDescendants<T>[];
|
|
574
|
+
|
|
575
|
+
type AllKeysUnion<T> = T extends object
|
|
576
|
+
? T[keyof T] extends infer K
|
|
577
|
+
? K extends string | number | symbol
|
|
578
|
+
? {[K in keyof T]-?: T[K] extends any[]
|
|
579
|
+
? GetTypeOfArray<T[K]> extends Record<RecordKey, any>
|
|
580
|
+
? `${K & string}` | `${K & string}${typeof URL_INCLUDE_PRISMA_DATA_KEYS_DELIM}${AllKeysUnion<GetTypeOfArray<T[K]>> & string}`
|
|
581
|
+
: never
|
|
582
|
+
: T[K] extends Function
|
|
583
|
+
? never
|
|
584
|
+
: `${K & string}` | `${K & string}${typeof URL_INCLUDE_PRISMA_DATA_KEYS_DELIM}${AllKeysUnion<T[K]> & string}`}[keyof T]
|
|
585
|
+
: never
|
|
586
|
+
: never
|
|
587
|
+
: never;
|
|
588
|
+
|
|
589
|
+
export type AllKeys<T> = AllKeysUnion<T>[];
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
export interface IAddress {
|
|
593
|
+
place?: string;
|
|
594
|
+
googlePlaceId?: string;
|
|
595
|
+
street: string;
|
|
596
|
+
city: string;
|
|
597
|
+
state: string;
|
|
598
|
+
zipCode: string;
|
|
599
|
+
country: string;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
export interface SocialMediaProfile {
|
|
604
|
+
id: string;
|
|
605
|
+
platform: string; // Enum type if available
|
|
606
|
+
url: string;
|
|
607
|
+
userId: string;
|
|
608
|
+
}
|