@bash-app/bash-common 20.4.0 → 20.5.1
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 +46 -46
- package/prisma/schema.prisma +1415 -1394
- package/src/definitions.ts +460 -460
- package/src/extendedSchemas.ts +359 -359
- package/src/index.ts +13 -13
- 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 +186 -186
- 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/sortUtils.ts +28 -28
- package/src/utils/ticketListUtils.ts +78 -78
- package/src/utils/urlUtils.ts +29 -29
- package/tsconfig.json +19 -19
package/src/extendedSchemas.ts
CHANGED
|
@@ -1,359 +1,359 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AmountOfGuests,
|
|
3
|
-
EventTask,
|
|
4
|
-
AssociatedBash,
|
|
5
|
-
BashEvent,
|
|
6
|
-
Invitation,
|
|
7
|
-
Ticket,
|
|
8
|
-
User,
|
|
9
|
-
TicketTier, Service, Review, Media, BashComment, Recurrence, Contact,
|
|
10
|
-
BashNotification, BashEventPromoCode,
|
|
11
|
-
Reminder, ServiceRange,
|
|
12
|
-
Checkout,
|
|
13
|
-
ServiceLink,
|
|
14
|
-
Link, Venue, Availability,
|
|
15
|
-
TargetAudience,
|
|
16
|
-
ServiceStatus,
|
|
17
|
-
Vendor,
|
|
18
|
-
EventService,
|
|
19
|
-
EntertainmentService,
|
|
20
|
-
Exhibitor,
|
|
21
|
-
Sponsor,
|
|
22
|
-
Organization,
|
|
23
|
-
Booking,
|
|
24
|
-
ServiceType,
|
|
25
|
-
} from "@prisma/client";
|
|
26
|
-
|
|
27
|
-
export const FRONT_END_USER_DATA_TO_SELECT = {
|
|
28
|
-
id: true,
|
|
29
|
-
email: true,
|
|
30
|
-
givenName: true,
|
|
31
|
-
familyName: true,
|
|
32
|
-
image: true,
|
|
33
|
-
uploadedImage: true,
|
|
34
|
-
services: true,
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const PRIVATE_USER_ACCOUNT_TO_SELECT = {
|
|
38
|
-
...FRONT_END_USER_DATA_TO_SELECT,
|
|
39
|
-
streetAddress: true,
|
|
40
|
-
city: true,
|
|
41
|
-
state: true,
|
|
42
|
-
postalCode: true,
|
|
43
|
-
country: true,
|
|
44
|
-
phone: true,
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface BashEventExt extends BashEvent {
|
|
48
|
-
targetAudience?: TargetAudience;
|
|
49
|
-
amountOfGuests?: AmountOfGuests;
|
|
50
|
-
recurrence?: Recurrence;
|
|
51
|
-
creator?: PublicUser;
|
|
52
|
-
ticketTiers: TicketTierExt[];
|
|
53
|
-
media: Media[];
|
|
54
|
-
eventTasks: EventTask[];
|
|
55
|
-
tickets?: Ticket[]; // Only include tickets that the user has purchased and not all tickets (could be thousands + privacy)
|
|
56
|
-
// Do not include in fetch. Could be hundreds of these
|
|
57
|
-
invitations: InvitationExt[];
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const TICKET_TIER_DATA_TO_INCLUDE = {
|
|
61
|
-
promoCodes: true,
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export const BASH_EVENT_DATA_TO_INCLUDE = {
|
|
65
|
-
creator: {
|
|
66
|
-
select: FRONT_END_USER_DATA_TO_SELECT
|
|
67
|
-
},
|
|
68
|
-
targetAudience: true,
|
|
69
|
-
amountOfGuests: true,
|
|
70
|
-
recurrence: true,
|
|
71
|
-
ticketTiers: {
|
|
72
|
-
include: TICKET_TIER_DATA_TO_INCLUDE
|
|
73
|
-
},
|
|
74
|
-
eventTasks: true,
|
|
75
|
-
media: true,
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export const BASH_EVENT_DATA_TO_CLONE = [
|
|
79
|
-
'ticketTiers',
|
|
80
|
-
'media',
|
|
81
|
-
'recurrence',
|
|
82
|
-
'invitations',
|
|
83
|
-
] as const;
|
|
84
|
-
|
|
85
|
-
type RemoveCommonProperties<T, U> = keyof (Omit<T, keyof U> & Omit<U, keyof T>);
|
|
86
|
-
export type UnionFromArray<T extends ReadonlyArray<any>> = T[number];
|
|
87
|
-
type BashEventExtMinusDataToCloneType = Omit<BashEventExt, UnionFromArray<typeof BASH_EVENT_DATA_TO_CLONE>>;
|
|
88
|
-
|
|
89
|
-
export const BASH_EVENT_DATA_TO_REMOVE: RemoveCommonProperties<BashEvent, BashEventExtMinusDataToCloneType>[] = [
|
|
90
|
-
'creator',
|
|
91
|
-
'eventTasks',
|
|
92
|
-
'tickets',
|
|
93
|
-
'targetAudience',
|
|
94
|
-
'amountOfGuests',
|
|
95
|
-
];
|
|
96
|
-
|
|
97
|
-
export interface BashNotificationExt extends BashNotification {
|
|
98
|
-
creator?: PublicUser;
|
|
99
|
-
bashEvent?: BashEvent;
|
|
100
|
-
eventTask?: EventTask;
|
|
101
|
-
invitation?: Invitation;
|
|
102
|
-
reminders?: Reminder[];
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export const BASH_NOTIFICATION_DATA_TO_INCLUDE = {
|
|
106
|
-
bashEvent: {
|
|
107
|
-
select: {
|
|
108
|
-
coverPhoto: true,
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
creator: {
|
|
112
|
-
select: {
|
|
113
|
-
image: true,
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export interface EventTaskExt extends EventTask {
|
|
120
|
-
creator: PublicUser;
|
|
121
|
-
assignedTo?: PublicUser | null;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export const EVENT_TASK_DATA_TO_INCLUDE = {
|
|
125
|
-
creator: {
|
|
126
|
-
select: FRONT_END_USER_DATA_TO_SELECT
|
|
127
|
-
},
|
|
128
|
-
assignedTo: {
|
|
129
|
-
select: FRONT_END_USER_DATA_TO_SELECT
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
export interface EventServiceExt extends EventService {
|
|
135
|
-
service: Service;
|
|
136
|
-
availableDateTimes: Availability[];
|
|
137
|
-
targetAudience: TargetAudience;
|
|
138
|
-
links: ServiceLinkExt[];
|
|
139
|
-
crowdSize?: AmountOfGuests;
|
|
140
|
-
media?: Media[];
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export interface EntertainmentServiceExt extends EntertainmentService {
|
|
144
|
-
service: Service;
|
|
145
|
-
availableDateTimes: Availability[];
|
|
146
|
-
targetAudience: TargetAudience;
|
|
147
|
-
links: ServiceLinkExt[];
|
|
148
|
-
crowdSize?: AmountOfGuests;
|
|
149
|
-
media?: Media[];
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export interface ExhibitorExt extends Exhibitor {
|
|
153
|
-
service: Service;
|
|
154
|
-
availableDateTimes: Availability[];
|
|
155
|
-
targetAudience: TargetAudience;
|
|
156
|
-
links: ServiceLinkExt[];
|
|
157
|
-
crowdSize?: AmountOfGuests;
|
|
158
|
-
media?: Media[];
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export interface SponsorExt extends Sponsor {
|
|
162
|
-
service: Service;
|
|
163
|
-
availableDateTimes: Availability[];
|
|
164
|
-
targetAudience: TargetAudience;
|
|
165
|
-
links: ServiceLinkExt[];
|
|
166
|
-
crowdSize?: AmountOfGuests;
|
|
167
|
-
media?: Media[];
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export interface VendorExt extends Vendor {
|
|
171
|
-
service: Service;
|
|
172
|
-
availableDateTimes: Availability[];
|
|
173
|
-
targetAudience?: TargetAudience;
|
|
174
|
-
links: ServiceLinkExt[];
|
|
175
|
-
crowdSize?: AmountOfGuests;
|
|
176
|
-
media?: Media[];
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export interface VenueExt extends Venue {
|
|
180
|
-
service: Service;
|
|
181
|
-
availableDateTimes: Availability[];
|
|
182
|
-
targetAudience?: TargetAudience | null;
|
|
183
|
-
links: ServiceLinkExt[];
|
|
184
|
-
capacity?: AmountOfGuests | null;
|
|
185
|
-
media?: Media[];
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export interface OrganizationExt extends Organization {
|
|
189
|
-
service: Service;
|
|
190
|
-
availableDateTimes: Availability[];
|
|
191
|
-
targetAudience: TargetAudience;
|
|
192
|
-
links: ServiceLinkExt[];
|
|
193
|
-
crowdSize?: AmountOfGuests;
|
|
194
|
-
media?: Media[];
|
|
195
|
-
status: ServiceStatus;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export const VENUE_DATA_TO_INCLUDE = {
|
|
199
|
-
service: true,
|
|
200
|
-
availableDateTimes: true,
|
|
201
|
-
targetAudience: true,
|
|
202
|
-
links: true,
|
|
203
|
-
capacity: true,
|
|
204
|
-
media: true,
|
|
205
|
-
}
|
|
206
|
-
export const VENDOR_DATA_TO_INCLUDE = {
|
|
207
|
-
service: true,
|
|
208
|
-
availableDateTimes: true,
|
|
209
|
-
targetAudience: true,
|
|
210
|
-
links: true,
|
|
211
|
-
crowdSize: true,
|
|
212
|
-
media: true,
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
export interface ServiceExt extends Service {
|
|
216
|
-
owner: PublicUser;
|
|
217
|
-
media: Media[];
|
|
218
|
-
serviceRange: ServiceRange;
|
|
219
|
-
targetAudience: TargetAudience;
|
|
220
|
-
serviceLinks?: ServiceLinkExt[];
|
|
221
|
-
venues?: Venue[];
|
|
222
|
-
eventServices?: EventService[];
|
|
223
|
-
entertainmentServices?: EntertainmentService[];
|
|
224
|
-
vendors?: Vendor[];
|
|
225
|
-
exhibitors?: Exhibitor[];
|
|
226
|
-
sponsors?: Sponsor[];
|
|
227
|
-
organizations?: Organization[];
|
|
228
|
-
bookings?: Booking[];
|
|
229
|
-
serviceTypes: ServiceType[];
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export interface ServiceLinkExt extends ServiceLink {
|
|
233
|
-
link: Link;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
export const SERVICE_LINK_DATA_TO_INCLUDE = {
|
|
237
|
-
link: true,
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
export const SERVICE_DATA_TO_INCLUDE = {
|
|
241
|
-
owner: {
|
|
242
|
-
select: FRONT_END_USER_DATA_TO_SELECT
|
|
243
|
-
},
|
|
244
|
-
media: true,
|
|
245
|
-
serviceRange: true,
|
|
246
|
-
targetAudience: true,
|
|
247
|
-
serviceLinks: {
|
|
248
|
-
include: SERVICE_LINK_DATA_TO_INCLUDE
|
|
249
|
-
},
|
|
250
|
-
venues: {
|
|
251
|
-
include: VENUE_DATA_TO_INCLUDE
|
|
252
|
-
},
|
|
253
|
-
vendors: {
|
|
254
|
-
include: VENDOR_DATA_TO_INCLUDE
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
export interface InvitationExt extends Invitation {
|
|
259
|
-
creator: PublicUser;
|
|
260
|
-
sentTo: PublicUser;
|
|
261
|
-
tickets: Ticket[];
|
|
262
|
-
associatedBash?: AssociatedBash | null;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
export const INVITATION_DATA_TO_INCLUDE = {
|
|
266
|
-
creator: {
|
|
267
|
-
select: FRONT_END_USER_DATA_TO_SELECT
|
|
268
|
-
},
|
|
269
|
-
sentTo: {
|
|
270
|
-
select: FRONT_END_USER_DATA_TO_SELECT
|
|
271
|
-
},
|
|
272
|
-
tickets: true,
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
export interface InvitationExtraData extends Invitation {
|
|
276
|
-
isFreeGuest?: boolean;
|
|
277
|
-
isOrganizer?: boolean;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
export interface AssociatedBashExt extends AssociatedBash {
|
|
281
|
-
bashEvent: BashEventExt;
|
|
282
|
-
invitation: InvitationExt;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
export const ASSOCIATED_BASH_DATA_TO_INCLUDE = {
|
|
286
|
-
bashEvent: {
|
|
287
|
-
include: BASH_EVENT_DATA_TO_INCLUDE
|
|
288
|
-
},
|
|
289
|
-
invitation: {
|
|
290
|
-
include: INVITATION_DATA_TO_INCLUDE
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
export interface TicketTierExt extends TicketTier {
|
|
295
|
-
bashEvent: BashEvent;
|
|
296
|
-
tickets: TicketExt[];
|
|
297
|
-
promoCodes: BashEventPromoCode[];
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
export interface TicketExt extends Ticket {
|
|
301
|
-
owner: PublicUser;
|
|
302
|
-
forUser: PublicUser;
|
|
303
|
-
checkout?: Checkout;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
export interface CheckoutExt extends Checkout {
|
|
307
|
-
owner: PublicUser;
|
|
308
|
-
tickets: Ticket[]
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
export const CHECKOUT_DATA_TO_INCLUDE = {
|
|
312
|
-
owner: {
|
|
313
|
-
select: FRONT_END_USER_DATA_TO_SELECT
|
|
314
|
-
},
|
|
315
|
-
tickets: {
|
|
316
|
-
select: {
|
|
317
|
-
ownerId: true
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
export interface ReviewExt extends Review {
|
|
323
|
-
comments: BashComment[];
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
export const CONTACT_DATA_TO_INCLUDE = {
|
|
327
|
-
user: {
|
|
328
|
-
select: FRONT_END_USER_DATA_TO_SELECT
|
|
329
|
-
},
|
|
330
|
-
media: true
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
export interface UserExtraData extends User {
|
|
335
|
-
password?: string;
|
|
336
|
-
otp?: string;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
export interface UserExt extends User {
|
|
340
|
-
services?: Service[] | null;
|
|
341
|
-
|
|
342
|
-
// Do not include in fetch as there could be thousands of these
|
|
343
|
-
associatedBashes?: AssociatedBash[] | null;
|
|
344
|
-
reviews?: ReviewExt[] | null;
|
|
345
|
-
contacts?: Contact[] | null;
|
|
346
|
-
ticketsIOwn?: TicketExt[] | null;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
export const USER_DATA_SELECT_REVIEWS_COMMENTS = {
|
|
350
|
-
reviews: {
|
|
351
|
-
include: {
|
|
352
|
-
comments: true
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
export type PublicUser = Pick<UserExt, keyof typeof FRONT_END_USER_DATA_TO_SELECT>
|
|
359
|
-
& Partial<Pick<UserExt, keyof typeof USER_DATA_SELECT_REVIEWS_COMMENTS>>;
|
|
1
|
+
import {
|
|
2
|
+
AmountOfGuests,
|
|
3
|
+
EventTask,
|
|
4
|
+
AssociatedBash,
|
|
5
|
+
BashEvent,
|
|
6
|
+
Invitation,
|
|
7
|
+
Ticket,
|
|
8
|
+
User,
|
|
9
|
+
TicketTier, Service, Review, Media, BashComment, Recurrence, Contact,
|
|
10
|
+
BashNotification, BashEventPromoCode,
|
|
11
|
+
Reminder, ServiceRange,
|
|
12
|
+
Checkout,
|
|
13
|
+
ServiceLink,
|
|
14
|
+
Link, Venue, Availability,
|
|
15
|
+
TargetAudience,
|
|
16
|
+
ServiceStatus,
|
|
17
|
+
Vendor,
|
|
18
|
+
EventService,
|
|
19
|
+
EntertainmentService,
|
|
20
|
+
Exhibitor,
|
|
21
|
+
Sponsor,
|
|
22
|
+
Organization,
|
|
23
|
+
Booking,
|
|
24
|
+
ServiceType,
|
|
25
|
+
} from "@prisma/client";
|
|
26
|
+
|
|
27
|
+
export const FRONT_END_USER_DATA_TO_SELECT = {
|
|
28
|
+
id: true,
|
|
29
|
+
email: true,
|
|
30
|
+
givenName: true,
|
|
31
|
+
familyName: true,
|
|
32
|
+
image: true,
|
|
33
|
+
uploadedImage: true,
|
|
34
|
+
services: true,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const PRIVATE_USER_ACCOUNT_TO_SELECT = {
|
|
38
|
+
...FRONT_END_USER_DATA_TO_SELECT,
|
|
39
|
+
streetAddress: true,
|
|
40
|
+
city: true,
|
|
41
|
+
state: true,
|
|
42
|
+
postalCode: true,
|
|
43
|
+
country: true,
|
|
44
|
+
phone: true,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface BashEventExt extends BashEvent {
|
|
48
|
+
targetAudience?: TargetAudience;
|
|
49
|
+
amountOfGuests?: AmountOfGuests;
|
|
50
|
+
recurrence?: Recurrence;
|
|
51
|
+
creator?: PublicUser;
|
|
52
|
+
ticketTiers: TicketTierExt[];
|
|
53
|
+
media: Media[];
|
|
54
|
+
eventTasks: EventTask[];
|
|
55
|
+
tickets?: Ticket[]; // Only include tickets that the user has purchased and not all tickets (could be thousands + privacy)
|
|
56
|
+
// Do not include in fetch. Could be hundreds of these
|
|
57
|
+
invitations: InvitationExt[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const TICKET_TIER_DATA_TO_INCLUDE = {
|
|
61
|
+
promoCodes: true,
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const BASH_EVENT_DATA_TO_INCLUDE = {
|
|
65
|
+
creator: {
|
|
66
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
67
|
+
},
|
|
68
|
+
targetAudience: true,
|
|
69
|
+
amountOfGuests: true,
|
|
70
|
+
recurrence: true,
|
|
71
|
+
ticketTiers: {
|
|
72
|
+
include: TICKET_TIER_DATA_TO_INCLUDE
|
|
73
|
+
},
|
|
74
|
+
eventTasks: true,
|
|
75
|
+
media: true,
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const BASH_EVENT_DATA_TO_CLONE = [
|
|
79
|
+
'ticketTiers',
|
|
80
|
+
'media',
|
|
81
|
+
'recurrence',
|
|
82
|
+
'invitations',
|
|
83
|
+
] as const;
|
|
84
|
+
|
|
85
|
+
type RemoveCommonProperties<T, U> = keyof (Omit<T, keyof U> & Omit<U, keyof T>);
|
|
86
|
+
export type UnionFromArray<T extends ReadonlyArray<any>> = T[number];
|
|
87
|
+
type BashEventExtMinusDataToCloneType = Omit<BashEventExt, UnionFromArray<typeof BASH_EVENT_DATA_TO_CLONE>>;
|
|
88
|
+
|
|
89
|
+
export const BASH_EVENT_DATA_TO_REMOVE: RemoveCommonProperties<BashEvent, BashEventExtMinusDataToCloneType>[] = [
|
|
90
|
+
'creator',
|
|
91
|
+
'eventTasks',
|
|
92
|
+
'tickets',
|
|
93
|
+
'targetAudience',
|
|
94
|
+
'amountOfGuests',
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
export interface BashNotificationExt extends BashNotification {
|
|
98
|
+
creator?: PublicUser;
|
|
99
|
+
bashEvent?: BashEvent;
|
|
100
|
+
eventTask?: EventTask;
|
|
101
|
+
invitation?: Invitation;
|
|
102
|
+
reminders?: Reminder[];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const BASH_NOTIFICATION_DATA_TO_INCLUDE = {
|
|
106
|
+
bashEvent: {
|
|
107
|
+
select: {
|
|
108
|
+
coverPhoto: true,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
creator: {
|
|
112
|
+
select: {
|
|
113
|
+
image: true,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface EventTaskExt extends EventTask {
|
|
120
|
+
creator: PublicUser;
|
|
121
|
+
assignedTo?: PublicUser | null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export const EVENT_TASK_DATA_TO_INCLUDE = {
|
|
125
|
+
creator: {
|
|
126
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
127
|
+
},
|
|
128
|
+
assignedTo: {
|
|
129
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
export interface EventServiceExt extends EventService {
|
|
135
|
+
service: Service;
|
|
136
|
+
availableDateTimes: Availability[];
|
|
137
|
+
targetAudience: TargetAudience;
|
|
138
|
+
links: ServiceLinkExt[];
|
|
139
|
+
crowdSize?: AmountOfGuests;
|
|
140
|
+
media?: Media[];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface EntertainmentServiceExt extends EntertainmentService {
|
|
144
|
+
service: Service;
|
|
145
|
+
availableDateTimes: Availability[];
|
|
146
|
+
targetAudience: TargetAudience;
|
|
147
|
+
links: ServiceLinkExt[];
|
|
148
|
+
crowdSize?: AmountOfGuests;
|
|
149
|
+
media?: Media[];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface ExhibitorExt extends Exhibitor {
|
|
153
|
+
service: Service;
|
|
154
|
+
availableDateTimes: Availability[];
|
|
155
|
+
targetAudience: TargetAudience;
|
|
156
|
+
links: ServiceLinkExt[];
|
|
157
|
+
crowdSize?: AmountOfGuests;
|
|
158
|
+
media?: Media[];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface SponsorExt extends Sponsor {
|
|
162
|
+
service: Service;
|
|
163
|
+
availableDateTimes: Availability[];
|
|
164
|
+
targetAudience: TargetAudience;
|
|
165
|
+
links: ServiceLinkExt[];
|
|
166
|
+
crowdSize?: AmountOfGuests;
|
|
167
|
+
media?: Media[];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface VendorExt extends Vendor {
|
|
171
|
+
service: Service;
|
|
172
|
+
availableDateTimes: Availability[];
|
|
173
|
+
targetAudience?: TargetAudience;
|
|
174
|
+
links: ServiceLinkExt[];
|
|
175
|
+
crowdSize?: AmountOfGuests;
|
|
176
|
+
media?: Media[];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface VenueExt extends Venue {
|
|
180
|
+
service: Service;
|
|
181
|
+
availableDateTimes: Availability[];
|
|
182
|
+
targetAudience?: TargetAudience | null;
|
|
183
|
+
links: ServiceLinkExt[];
|
|
184
|
+
capacity?: AmountOfGuests | null;
|
|
185
|
+
media?: Media[];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface OrganizationExt extends Organization {
|
|
189
|
+
service: Service;
|
|
190
|
+
availableDateTimes: Availability[];
|
|
191
|
+
targetAudience: TargetAudience;
|
|
192
|
+
links: ServiceLinkExt[];
|
|
193
|
+
crowdSize?: AmountOfGuests;
|
|
194
|
+
media?: Media[];
|
|
195
|
+
status: ServiceStatus;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export const VENUE_DATA_TO_INCLUDE = {
|
|
199
|
+
service: true,
|
|
200
|
+
availableDateTimes: true,
|
|
201
|
+
targetAudience: true,
|
|
202
|
+
links: true,
|
|
203
|
+
capacity: true,
|
|
204
|
+
media: true,
|
|
205
|
+
}
|
|
206
|
+
export const VENDOR_DATA_TO_INCLUDE = {
|
|
207
|
+
service: true,
|
|
208
|
+
availableDateTimes: true,
|
|
209
|
+
targetAudience: true,
|
|
210
|
+
links: true,
|
|
211
|
+
crowdSize: true,
|
|
212
|
+
media: true,
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface ServiceExt extends Service {
|
|
216
|
+
owner: PublicUser;
|
|
217
|
+
media: Media[];
|
|
218
|
+
serviceRange: ServiceRange;
|
|
219
|
+
targetAudience: TargetAudience;
|
|
220
|
+
serviceLinks?: ServiceLinkExt[];
|
|
221
|
+
venues?: Venue[];
|
|
222
|
+
eventServices?: EventService[];
|
|
223
|
+
entertainmentServices?: EntertainmentService[];
|
|
224
|
+
vendors?: Vendor[];
|
|
225
|
+
exhibitors?: Exhibitor[];
|
|
226
|
+
sponsors?: Sponsor[];
|
|
227
|
+
organizations?: Organization[];
|
|
228
|
+
bookings?: Booking[];
|
|
229
|
+
serviceTypes: ServiceType[];
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export interface ServiceLinkExt extends ServiceLink {
|
|
233
|
+
link: Link;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export const SERVICE_LINK_DATA_TO_INCLUDE = {
|
|
237
|
+
link: true,
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export const SERVICE_DATA_TO_INCLUDE = {
|
|
241
|
+
owner: {
|
|
242
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
243
|
+
},
|
|
244
|
+
media: true,
|
|
245
|
+
serviceRange: true,
|
|
246
|
+
targetAudience: true,
|
|
247
|
+
serviceLinks: {
|
|
248
|
+
include: SERVICE_LINK_DATA_TO_INCLUDE
|
|
249
|
+
},
|
|
250
|
+
venues: {
|
|
251
|
+
include: VENUE_DATA_TO_INCLUDE
|
|
252
|
+
},
|
|
253
|
+
vendors: {
|
|
254
|
+
include: VENDOR_DATA_TO_INCLUDE
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export interface InvitationExt extends Invitation {
|
|
259
|
+
creator: PublicUser;
|
|
260
|
+
sentTo: PublicUser;
|
|
261
|
+
tickets: Ticket[];
|
|
262
|
+
associatedBash?: AssociatedBash | null;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export const INVITATION_DATA_TO_INCLUDE = {
|
|
266
|
+
creator: {
|
|
267
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
268
|
+
},
|
|
269
|
+
sentTo: {
|
|
270
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
271
|
+
},
|
|
272
|
+
tickets: true,
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export interface InvitationExtraData extends Invitation {
|
|
276
|
+
isFreeGuest?: boolean;
|
|
277
|
+
isOrganizer?: boolean;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export interface AssociatedBashExt extends AssociatedBash {
|
|
281
|
+
bashEvent: BashEventExt;
|
|
282
|
+
invitation: InvitationExt;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export const ASSOCIATED_BASH_DATA_TO_INCLUDE = {
|
|
286
|
+
bashEvent: {
|
|
287
|
+
include: BASH_EVENT_DATA_TO_INCLUDE
|
|
288
|
+
},
|
|
289
|
+
invitation: {
|
|
290
|
+
include: INVITATION_DATA_TO_INCLUDE
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export interface TicketTierExt extends TicketTier {
|
|
295
|
+
bashEvent: BashEvent;
|
|
296
|
+
tickets: TicketExt[];
|
|
297
|
+
promoCodes: BashEventPromoCode[];
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface TicketExt extends Ticket {
|
|
301
|
+
owner: PublicUser;
|
|
302
|
+
forUser: PublicUser;
|
|
303
|
+
checkout?: Checkout;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export interface CheckoutExt extends Checkout {
|
|
307
|
+
owner: PublicUser;
|
|
308
|
+
tickets: Ticket[]
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export const CHECKOUT_DATA_TO_INCLUDE = {
|
|
312
|
+
owner: {
|
|
313
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
314
|
+
},
|
|
315
|
+
tickets: {
|
|
316
|
+
select: {
|
|
317
|
+
ownerId: true
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export interface ReviewExt extends Review {
|
|
323
|
+
comments: BashComment[];
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export const CONTACT_DATA_TO_INCLUDE = {
|
|
327
|
+
user: {
|
|
328
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
329
|
+
},
|
|
330
|
+
media: true
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
export interface UserExtraData extends User {
|
|
335
|
+
password?: string;
|
|
336
|
+
otp?: string;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export interface UserExt extends User {
|
|
340
|
+
services?: Service[] | null;
|
|
341
|
+
|
|
342
|
+
// Do not include in fetch as there could be thousands of these
|
|
343
|
+
associatedBashes?: AssociatedBash[] | null;
|
|
344
|
+
reviews?: ReviewExt[] | null;
|
|
345
|
+
contacts?: Contact[] | null;
|
|
346
|
+
ticketsIOwn?: TicketExt[] | null;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export const USER_DATA_SELECT_REVIEWS_COMMENTS = {
|
|
350
|
+
reviews: {
|
|
351
|
+
include: {
|
|
352
|
+
comments: true
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
export type PublicUser = Pick<UserExt, keyof typeof FRONT_END_USER_DATA_TO_SELECT>
|
|
359
|
+
& Partial<Pick<UserExt, keyof typeof USER_DATA_SELECT_REVIEWS_COMMENTS>>;
|