@bash-app/bash-common 22.0.2 → 23.1.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/README.md +8 -8
- package/package.json +46 -46
- package/prisma/schema.prisma +1410 -1397
- package/src/definitions.ts +486 -486
- package/src/extendedSchemas.ts +385 -361
- package/src/index.ts +13 -13
- package/src/utils/addressUtils.ts +172 -172
- 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,361 +1,385 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AmountOfGuests,
|
|
3
|
-
EventTask,
|
|
4
|
-
AssociatedBash,
|
|
5
|
-
BashEvent,
|
|
6
|
-
Invitation,
|
|
7
|
-
Ticket,
|
|
8
|
-
User,
|
|
9
|
-
TicketTier, Business, Review, Media, BashComment, Recurrence, Contact,
|
|
10
|
-
BashNotification, BashEventPromoCode,
|
|
11
|
-
Reminder,
|
|
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
|
-
VolunteerService, Prisma, ServiceRange,
|
|
25
|
-
} from "@prisma/client";
|
|
26
|
-
import {UnionFromArray} from "./definitions";
|
|
27
|
-
|
|
28
|
-
export const FRONT_END_USER_DATA_TO_SELECT = {
|
|
29
|
-
id: true,
|
|
30
|
-
email: true,
|
|
31
|
-
givenName: true,
|
|
32
|
-
familyName: true,
|
|
33
|
-
image: true,
|
|
34
|
-
uploadedImage: true,
|
|
35
|
-
} satisfies Prisma.UserSelect;
|
|
36
|
-
|
|
37
|
-
export const PRIVATE_USER_ACCOUNT_TO_SELECT = {
|
|
38
|
-
...FRONT_END_USER_DATA_TO_SELECT,
|
|
39
|
-
street: true,
|
|
40
|
-
city: true,
|
|
41
|
-
state: true,
|
|
42
|
-
zipCode: true,
|
|
43
|
-
country: true,
|
|
44
|
-
phone: true,
|
|
45
|
-
} satisfies Prisma.UserSelect;
|
|
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
|
-
} satisfies Prisma.TicketTierInclude;
|
|
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
|
-
} satisfies Prisma.BashEventInclude;
|
|
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
|
-
type BashEventExtMinusDataToCloneType = Omit<BashEventExt, UnionFromArray<typeof BASH_EVENT_DATA_TO_CLONE>>;
|
|
87
|
-
|
|
88
|
-
export const BASH_EVENT_DATA_TO_REMOVE: RemoveCommonProperties<BashEvent, BashEventExtMinusDataToCloneType>[] = [
|
|
89
|
-
'creator',
|
|
90
|
-
'eventTasks',
|
|
91
|
-
'tickets',
|
|
92
|
-
'targetAudience',
|
|
93
|
-
'amountOfGuests',
|
|
94
|
-
];
|
|
95
|
-
|
|
96
|
-
export interface BashNotificationExt extends BashNotification {
|
|
97
|
-
creator?: PublicUser;
|
|
98
|
-
bashEvent?: BashEvent;
|
|
99
|
-
eventTask?: EventTask;
|
|
100
|
-
invitation?: Invitation;
|
|
101
|
-
reminders?: Reminder[];
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export const BASH_NOTIFICATION_DATA_TO_INCLUDE = {
|
|
105
|
-
bashEvent: {
|
|
106
|
-
select: {
|
|
107
|
-
coverPhoto: true,
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
creator: {
|
|
111
|
-
select: {
|
|
112
|
-
image: true,
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
} satisfies Prisma.BashNotificationInclude;
|
|
116
|
-
|
|
117
|
-
export interface EventTaskExt extends EventTask {
|
|
118
|
-
creator: PublicUser;
|
|
119
|
-
assignedTo?: PublicUser | null;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export const EVENT_TASK_DATA_TO_INCLUDE = {
|
|
123
|
-
creator: {
|
|
124
|
-
select: FRONT_END_USER_DATA_TO_SELECT
|
|
125
|
-
},
|
|
126
|
-
assignedTo: {
|
|
127
|
-
select: FRONT_END_USER_DATA_TO_SELECT
|
|
128
|
-
}
|
|
129
|
-
} satisfies Prisma.EventTaskInclude;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
export interface EventServiceExt extends EventService {
|
|
133
|
-
business: Business;
|
|
134
|
-
availableDateTimes: Availability[];
|
|
135
|
-
targetAudience: TargetAudience;
|
|
136
|
-
links: ServiceLinkExt[];
|
|
137
|
-
crowdSize?: AmountOfGuests;
|
|
138
|
-
media?: Media[];
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export interface EntertainmentServiceExt extends EntertainmentService {
|
|
142
|
-
business: Business;
|
|
143
|
-
availableDateTimes: Availability[];
|
|
144
|
-
targetAudience: TargetAudience;
|
|
145
|
-
links: ServiceLinkExt[];
|
|
146
|
-
crowdSize?: AmountOfGuests;
|
|
147
|
-
media?: Media[];
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export interface ExhibitorExt extends Exhibitor {
|
|
151
|
-
business: Business;
|
|
152
|
-
availableDateTimes: Availability[];
|
|
153
|
-
targetAudience: TargetAudience;
|
|
154
|
-
links: ServiceLinkExt[];
|
|
155
|
-
crowdSize?: AmountOfGuests;
|
|
156
|
-
media?: Media[];
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export interface SponsorExt extends Sponsor {
|
|
160
|
-
business: Business;
|
|
161
|
-
availableDateTimes: Availability[];
|
|
162
|
-
targetAudience: TargetAudience;
|
|
163
|
-
links: ServiceLinkExt[];
|
|
164
|
-
crowdSize?: AmountOfGuests;
|
|
165
|
-
media?: Media[];
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export interface VendorExt extends Vendor {
|
|
169
|
-
business: Business;
|
|
170
|
-
availableDateTimes: Availability[];
|
|
171
|
-
targetAudience?: TargetAudience;
|
|
172
|
-
links: ServiceLinkExt[];
|
|
173
|
-
crowdSize?: AmountOfGuests;
|
|
174
|
-
media?: Media[];
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export const VENDOR_DATA_TO_INCLUDE = {
|
|
178
|
-
business: true,
|
|
179
|
-
availableDateTimes: true,
|
|
180
|
-
targetAudience: true,
|
|
181
|
-
links: true,
|
|
182
|
-
crowdSize: true,
|
|
183
|
-
media: true,
|
|
184
|
-
} satisfies Prisma.VendorInclude;
|
|
185
|
-
|
|
186
|
-
export const SERVICE_LINK_DATA_TO_INCLUDE = {
|
|
187
|
-
link: true,
|
|
188
|
-
} satisfies Prisma.ServiceLinkInclude;
|
|
189
|
-
|
|
190
|
-
export interface VenueExt extends Venue {
|
|
191
|
-
business: Business;
|
|
192
|
-
availableDateTimes: Availability[];
|
|
193
|
-
targetAudience?: TargetAudience | null;
|
|
194
|
-
links: ServiceLinkExt[];
|
|
195
|
-
serviceRange: ServiceRange;
|
|
196
|
-
media?: Media[];
|
|
197
|
-
amountOfGuests?: AmountOfGuests | null; // Reflecting the correct relation with AmountOfGuests
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export const VENUE_DATA_TO_INCLUDE = {
|
|
201
|
-
business: true,
|
|
202
|
-
availableDateTimes: true,
|
|
203
|
-
targetAudience: true,
|
|
204
|
-
links: {
|
|
205
|
-
include: SERVICE_LINK_DATA_TO_INCLUDE
|
|
206
|
-
},
|
|
207
|
-
media: true,
|
|
208
|
-
serviceRange: true,
|
|
209
|
-
amountOfGuests: true,
|
|
210
|
-
} satisfies Prisma.VenueInclude;
|
|
211
|
-
|
|
212
|
-
export
|
|
213
|
-
business:
|
|
214
|
-
availableDateTimes:
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
},
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
},
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
tickets:
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
} satisfies Prisma.
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
export
|
|
361
|
-
|
|
1
|
+
import {
|
|
2
|
+
AmountOfGuests,
|
|
3
|
+
EventTask,
|
|
4
|
+
AssociatedBash,
|
|
5
|
+
BashEvent,
|
|
6
|
+
Invitation,
|
|
7
|
+
Ticket,
|
|
8
|
+
User,
|
|
9
|
+
TicketTier, Business, Review, Media, BashComment, Recurrence, Contact,
|
|
10
|
+
BashNotification, BashEventPromoCode,
|
|
11
|
+
Reminder,
|
|
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
|
+
VolunteerService, Prisma, ServiceRange,
|
|
25
|
+
} from "@prisma/client";
|
|
26
|
+
import {UnionFromArray} from "./definitions";
|
|
27
|
+
|
|
28
|
+
export const FRONT_END_USER_DATA_TO_SELECT = {
|
|
29
|
+
id: true,
|
|
30
|
+
email: true,
|
|
31
|
+
givenName: true,
|
|
32
|
+
familyName: true,
|
|
33
|
+
image: true,
|
|
34
|
+
uploadedImage: true,
|
|
35
|
+
} satisfies Prisma.UserSelect;
|
|
36
|
+
|
|
37
|
+
export const PRIVATE_USER_ACCOUNT_TO_SELECT = {
|
|
38
|
+
...FRONT_END_USER_DATA_TO_SELECT,
|
|
39
|
+
street: true,
|
|
40
|
+
city: true,
|
|
41
|
+
state: true,
|
|
42
|
+
zipCode: true,
|
|
43
|
+
country: true,
|
|
44
|
+
phone: true,
|
|
45
|
+
} satisfies Prisma.UserSelect;
|
|
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
|
+
} satisfies Prisma.TicketTierInclude;
|
|
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
|
+
} satisfies Prisma.BashEventInclude;
|
|
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
|
+
type BashEventExtMinusDataToCloneType = Omit<BashEventExt, UnionFromArray<typeof BASH_EVENT_DATA_TO_CLONE>>;
|
|
87
|
+
|
|
88
|
+
export const BASH_EVENT_DATA_TO_REMOVE: RemoveCommonProperties<BashEvent, BashEventExtMinusDataToCloneType>[] = [
|
|
89
|
+
'creator',
|
|
90
|
+
'eventTasks',
|
|
91
|
+
'tickets',
|
|
92
|
+
'targetAudience',
|
|
93
|
+
'amountOfGuests',
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
export interface BashNotificationExt extends BashNotification {
|
|
97
|
+
creator?: PublicUser;
|
|
98
|
+
bashEvent?: BashEvent;
|
|
99
|
+
eventTask?: EventTask;
|
|
100
|
+
invitation?: Invitation;
|
|
101
|
+
reminders?: Reminder[];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export const BASH_NOTIFICATION_DATA_TO_INCLUDE = {
|
|
105
|
+
bashEvent: {
|
|
106
|
+
select: {
|
|
107
|
+
coverPhoto: true,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
creator: {
|
|
111
|
+
select: {
|
|
112
|
+
image: true,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
} satisfies Prisma.BashNotificationInclude;
|
|
116
|
+
|
|
117
|
+
export interface EventTaskExt extends EventTask {
|
|
118
|
+
creator: PublicUser;
|
|
119
|
+
assignedTo?: PublicUser | null;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const EVENT_TASK_DATA_TO_INCLUDE = {
|
|
123
|
+
creator: {
|
|
124
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
125
|
+
},
|
|
126
|
+
assignedTo: {
|
|
127
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
128
|
+
}
|
|
129
|
+
} satisfies Prisma.EventTaskInclude;
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
export interface EventServiceExt extends EventService {
|
|
133
|
+
business: Business;
|
|
134
|
+
availableDateTimes: Availability[];
|
|
135
|
+
targetAudience: TargetAudience;
|
|
136
|
+
links: ServiceLinkExt[];
|
|
137
|
+
crowdSize?: AmountOfGuests;
|
|
138
|
+
media?: Media[];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface EntertainmentServiceExt extends EntertainmentService {
|
|
142
|
+
business: Business;
|
|
143
|
+
availableDateTimes: Availability[];
|
|
144
|
+
targetAudience: TargetAudience;
|
|
145
|
+
links: ServiceLinkExt[];
|
|
146
|
+
crowdSize?: AmountOfGuests;
|
|
147
|
+
media?: Media[];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface ExhibitorExt extends Exhibitor {
|
|
151
|
+
business: Business;
|
|
152
|
+
availableDateTimes: Availability[];
|
|
153
|
+
targetAudience: TargetAudience;
|
|
154
|
+
links: ServiceLinkExt[];
|
|
155
|
+
crowdSize?: AmountOfGuests;
|
|
156
|
+
media?: Media[];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface SponsorExt extends Sponsor {
|
|
160
|
+
business: Business;
|
|
161
|
+
availableDateTimes: Availability[];
|
|
162
|
+
targetAudience: TargetAudience;
|
|
163
|
+
links: ServiceLinkExt[];
|
|
164
|
+
crowdSize?: AmountOfGuests;
|
|
165
|
+
media?: Media[];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface VendorExt extends Vendor {
|
|
169
|
+
business: Business;
|
|
170
|
+
availableDateTimes: Availability[];
|
|
171
|
+
targetAudience?: TargetAudience;
|
|
172
|
+
links: ServiceLinkExt[];
|
|
173
|
+
crowdSize?: AmountOfGuests;
|
|
174
|
+
media?: Media[];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export const VENDOR_DATA_TO_INCLUDE = {
|
|
178
|
+
business: true,
|
|
179
|
+
availableDateTimes: true,
|
|
180
|
+
targetAudience: true,
|
|
181
|
+
links: true,
|
|
182
|
+
crowdSize: true,
|
|
183
|
+
media: true,
|
|
184
|
+
} satisfies Prisma.VendorInclude;
|
|
185
|
+
|
|
186
|
+
export const SERVICE_LINK_DATA_TO_INCLUDE = {
|
|
187
|
+
link: true,
|
|
188
|
+
} satisfies Prisma.ServiceLinkInclude;
|
|
189
|
+
|
|
190
|
+
export interface VenueExt extends Venue {
|
|
191
|
+
business: Business;
|
|
192
|
+
availableDateTimes: Availability[];
|
|
193
|
+
targetAudience?: TargetAudience | null;
|
|
194
|
+
links: ServiceLinkExt[];
|
|
195
|
+
serviceRange: ServiceRange;
|
|
196
|
+
media?: Media[];
|
|
197
|
+
amountOfGuests?: AmountOfGuests | null; // Reflecting the correct relation with AmountOfGuests
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export const VENUE_DATA_TO_INCLUDE = {
|
|
201
|
+
business: true,
|
|
202
|
+
availableDateTimes: true,
|
|
203
|
+
targetAudience: true,
|
|
204
|
+
links: {
|
|
205
|
+
include: SERVICE_LINK_DATA_TO_INCLUDE
|
|
206
|
+
},
|
|
207
|
+
media: true,
|
|
208
|
+
serviceRange: true,
|
|
209
|
+
amountOfGuests: true,
|
|
210
|
+
} satisfies Prisma.VenueInclude;
|
|
211
|
+
|
|
212
|
+
export const VOLUNTEER_DATA_TO_INCLUDE = {
|
|
213
|
+
business: true,
|
|
214
|
+
availableDateTimes: true,
|
|
215
|
+
links: {
|
|
216
|
+
include: {
|
|
217
|
+
serviceLinks: true,
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
media: true,
|
|
221
|
+
serviceRange: true,
|
|
222
|
+
} satisfies Prisma.VolunteerServiceInclude;
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
export interface OrganizationExt extends Organization {
|
|
227
|
+
business: Business;
|
|
228
|
+
availableDateTimes: Availability[];
|
|
229
|
+
targetAudience: TargetAudience;
|
|
230
|
+
links: ServiceLinkExt[];
|
|
231
|
+
crowdSize?: AmountOfGuests;
|
|
232
|
+
media?: Media[];
|
|
233
|
+
status: ServiceStatus;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface VolunteerServiceExt extends VolunteerService {
|
|
237
|
+
serviceRange?: ServiceRange;
|
|
238
|
+
media?: Media[];
|
|
239
|
+
links?: Link[];
|
|
240
|
+
availableDateTimes?: Availability[];
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
export interface BusinessExt extends Business {
|
|
245
|
+
owner: PublicUser;
|
|
246
|
+
media: Media[];
|
|
247
|
+
targetAudience?: TargetAudience | null;
|
|
248
|
+
volunteerService?: VolunteerService | null;
|
|
249
|
+
serviceLinks?: ServiceLinkExt[];
|
|
250
|
+
venues?: Venue[];
|
|
251
|
+
eventServices?: EventService[];
|
|
252
|
+
entertainmentServices?: EntertainmentService[];
|
|
253
|
+
vendors?: Vendor[];
|
|
254
|
+
exhibitors?: Exhibitor[];
|
|
255
|
+
sponsors?: Sponsor[];
|
|
256
|
+
organizations?: Organization[];
|
|
257
|
+
bookings?: Booking[];
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export const BUSINESS_DATA_TO_INCLUDE = {
|
|
261
|
+
owner: {
|
|
262
|
+
select: FRONT_END_USER_DATA_TO_SELECT,
|
|
263
|
+
},
|
|
264
|
+
media: true,
|
|
265
|
+
volunteerService: {
|
|
266
|
+
include: VOLUNTEER_DATA_TO_INCLUDE,
|
|
267
|
+
},
|
|
268
|
+
targetAudience: true,
|
|
269
|
+
serviceLinks: {
|
|
270
|
+
include: SERVICE_LINK_DATA_TO_INCLUDE,
|
|
271
|
+
},
|
|
272
|
+
venues: {
|
|
273
|
+
include: VENUE_DATA_TO_INCLUDE,
|
|
274
|
+
},
|
|
275
|
+
vendors: {
|
|
276
|
+
include: VENDOR_DATA_TO_INCLUDE,
|
|
277
|
+
},
|
|
278
|
+
} satisfies Prisma.BusinessInclude;
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
export interface ServiceLinkExt extends ServiceLink {
|
|
282
|
+
link: Link;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export interface InvitationExt extends Invitation {
|
|
286
|
+
creator: PublicUser;
|
|
287
|
+
sentTo: PublicUser;
|
|
288
|
+
tickets: Ticket[];
|
|
289
|
+
associatedBash?: AssociatedBash | null;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export const INVITATION_DATA_TO_INCLUDE = {
|
|
293
|
+
creator: {
|
|
294
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
295
|
+
},
|
|
296
|
+
sentTo: {
|
|
297
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
298
|
+
},
|
|
299
|
+
tickets: true,
|
|
300
|
+
} satisfies Prisma.InvitationInclude;
|
|
301
|
+
|
|
302
|
+
export interface InvitationExtraData extends Invitation {
|
|
303
|
+
isFreeGuest?: boolean;
|
|
304
|
+
isOrganizer?: boolean;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export interface AssociatedBashExt extends AssociatedBash {
|
|
308
|
+
bashEvent: BashEventExt;
|
|
309
|
+
invitation: InvitationExt;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export const ASSOCIATED_BASH_DATA_TO_INCLUDE = {
|
|
313
|
+
bashEvent: {
|
|
314
|
+
include: BASH_EVENT_DATA_TO_INCLUDE
|
|
315
|
+
},
|
|
316
|
+
invitation: {
|
|
317
|
+
include: INVITATION_DATA_TO_INCLUDE
|
|
318
|
+
}
|
|
319
|
+
} satisfies Prisma.AssociatedBashInclude;
|
|
320
|
+
|
|
321
|
+
export interface TicketTierExt extends TicketTier {
|
|
322
|
+
bashEvent: BashEvent;
|
|
323
|
+
tickets: TicketExt[];
|
|
324
|
+
promoCodes: BashEventPromoCode[];
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export interface TicketExt extends Ticket {
|
|
328
|
+
owner: PublicUser;
|
|
329
|
+
forUser: PublicUser;
|
|
330
|
+
checkout?: Checkout;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export interface CheckoutExt extends Checkout {
|
|
334
|
+
owner: PublicUser;
|
|
335
|
+
tickets: Ticket[]
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export const CHECKOUT_DATA_TO_INCLUDE = {
|
|
339
|
+
owner: {
|
|
340
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
341
|
+
},
|
|
342
|
+
tickets: {
|
|
343
|
+
select: {
|
|
344
|
+
ownerId: true
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
} satisfies Prisma.CheckoutInclude;
|
|
348
|
+
|
|
349
|
+
export interface ReviewExt extends Review {
|
|
350
|
+
comments: BashComment[];
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export const CONTACT_DATA_TO_INCLUDE = {
|
|
354
|
+
contactOwner: {
|
|
355
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
356
|
+
},
|
|
357
|
+
} satisfies Prisma.ContactInclude;
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
export interface UserExtraData extends User {
|
|
361
|
+
password?: string;
|
|
362
|
+
otp?: string;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export interface UserExt extends User {
|
|
366
|
+
businesses?: Business[] | null;
|
|
367
|
+
|
|
368
|
+
// Do not include in fetch as there could be thousands of these
|
|
369
|
+
associatedBashes?: AssociatedBash[] | null;
|
|
370
|
+
reviews?: ReviewExt[] | null;
|
|
371
|
+
contacts?: Contact[] | null;
|
|
372
|
+
ticketsIOwn?: TicketExt[] | null;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export const USER_DATA_SELECT_REVIEWS_COMMENTS = {
|
|
376
|
+
reviews: {
|
|
377
|
+
include: {
|
|
378
|
+
comments: true
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
} satisfies Prisma.UserSelect;
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
export type PublicUser = Pick<UserExt, keyof typeof FRONT_END_USER_DATA_TO_SELECT>
|
|
385
|
+
& Partial<Pick<UserExt, keyof typeof USER_DATA_SELECT_REVIEWS_COMMENTS>>;
|