@bash-app/bash-common 19.0.1 → 19.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash-app/bash-common",
3
- "version": "19.0.1",
3
+ "version": "19.1.0",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -243,6 +243,7 @@ model BashEvent {
243
243
  subtitle String?
244
244
  isFeatured Boolean?
245
245
  isTrending Boolean?
246
+ ServiceCheckout ServiceCheckout[]
246
247
  }
247
248
 
248
249
  model Checkout {
@@ -254,10 +255,22 @@ model Checkout {
254
255
  checkoutDateTime DateTime? @default(now())
255
256
  tickets Ticket[]
256
257
  stripeCheckoutSessionId String? @unique
258
+ Booking Booking[]
257
259
 
258
260
  @@index(bashEventId)
259
261
  }
260
262
 
263
+ model ServiceCheckout {
264
+ id String @id @default(cuid())
265
+ ownerId String
266
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
267
+ bashEventId String
268
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
269
+ checkoutDateTime DateTime? @default(now())
270
+ tickets Ticket[]
271
+ stripeCheckoutSessionId String? @unique
272
+ }
273
+
261
274
  model TicketTier {
262
275
  id String @id @default(cuid())
263
276
  bashEventId String
@@ -277,16 +290,16 @@ model TicketTier {
277
290
  }
278
291
 
279
292
  model Ticket {
280
- id String @id @default(cuid())
293
+ id String @id @default(cuid())
281
294
  ownerId String
282
- owner User @relation("TicketsIOwn", fields: [ownerId], references: [id])
295
+ owner User @relation("TicketsIOwn", fields: [ownerId], references: [id])
283
296
  bashEventId String
284
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id])
297
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id])
285
298
  ticketTierId String?
286
- ticketTier TicketTier? @relation(fields: [ticketTierId], references: [id])
299
+ ticketTier TicketTier? @relation(fields: [ticketTierId], references: [id])
287
300
  validDate DateTime?
288
301
  forUserId String?
289
- forUser User? @relation("TicketsISent", fields: [forUserId], references: [id])
302
+ forUser User? @relation("TicketsISent", fields: [forUserId], references: [id])
290
303
  fullName String?
291
304
  email String?
292
305
  paidOn DateTime?
@@ -297,9 +310,11 @@ model Ticket {
297
310
  checkedInAt DateTime?
298
311
  checkedOutAt DateTime?
299
312
  invitationId String?
300
- invitation Invitation? @relation("TicketsForInvitation", fields: [invitationId], references: [id])
313
+ invitation Invitation? @relation("TicketsForInvitation", fields: [invitationId], references: [id])
301
314
  checkoutId String?
302
- checkout Checkout? @relation(fields: [checkoutId], references: [id])
315
+ checkout Checkout? @relation(fields: [checkoutId], references: [id])
316
+ ServiceCheckout ServiceCheckout? @relation(fields: [serviceCheckoutId], references: [id])
317
+ serviceCheckoutId String?
303
318
 
304
319
  @@index([bashEventId])
305
320
  }
@@ -310,6 +325,38 @@ enum TicketStatus {
310
325
  Missed
311
326
  }
312
327
 
328
+ enum BookingStatus {
329
+ Cancelled
330
+ Completed
331
+ Missed
332
+ }
333
+
334
+ model Booking {
335
+ id String @id @default(cuid())
336
+ ownerId String
337
+ owner User @relation("BookingsIHave", fields: [ownerId], references: [id])
338
+ serviceId String
339
+ service Service @relation(fields: [serviceId], references: [id])
340
+ validDate DateTime?
341
+ forUserId String?
342
+ forUser User? @relation("BookingsISent", fields: [forUserId], references: [id])
343
+ fullName String?
344
+ email String?
345
+ paidOn DateTime?
346
+ requireDeposit Boolean?
347
+ status BookingStatus?
348
+ geoFenceCheckInUnnecessary Boolean?
349
+ checkedInAt DateTime?
350
+ checkedOutAt DateTime?
351
+ checkoutId String?
352
+ checkout Checkout? @relation(fields: [checkoutId], references: [id])
353
+
354
+ @@index([serviceId])
355
+ @@index([ownerId])
356
+ @@index([forUserId])
357
+ @@index([checkoutId])
358
+ }
359
+
313
360
  model unusedModelButNeededForSomeTypesToBeDefinedForTypescript {
314
361
  id String @id @default(cuid())
315
362
  doNotUseVibeEnum BashEventVibeTags @default(Wild)
@@ -792,6 +839,9 @@ model User {
792
839
  ticketTiersWaitListsIveJoined TicketTier[]
793
840
  contacts Contact[]
794
841
  bashEventPromoCodesIUsed BashEventPromoCode[]
842
+ bookingsSent Booking[] @relation("BookingsISent")
843
+ bookingsReceived Booking[] @relation("BookingsIHave")
844
+ ServiceCheckout ServiceCheckout[]
795
845
  }
796
846
 
797
847
  model Contact {
@@ -828,14 +878,16 @@ model Service {
828
878
  ownerId String
829
879
  owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
830
880
  serviceId String
881
+ dateCreated DateTime
831
882
  email String
883
+ location String?
832
884
  streetAddress String
833
885
  city String
834
886
  state String
835
887
  postalCode String
836
888
  country String
837
889
  phone String
838
- name String
890
+ name String
839
891
  coverPhoto String?
840
892
  agreedToAgreement Boolean?
841
893
  media Media[]
@@ -867,6 +919,7 @@ model Service {
867
919
  contactPhone String?
868
920
  contactEmail String?
869
921
  businessPhone String?
922
+ bookings Booking[]
870
923
 
871
924
  @@index([email])
872
925
  @@index([phone])
@@ -4,6 +4,7 @@ import {
4
4
  BashEventVibeTags,
5
5
  Contact,
6
6
  DayOfWeek,
7
+ ServiceType,
7
8
  Ticket,
8
9
  TicketTier,
9
10
  User,
@@ -410,6 +411,20 @@ export const BashEventTypeToString: BashEventTypeToStringType = {
410
411
  [BashEventType.Other]: "Other",
411
412
  }
412
413
 
414
+ export type ServiceTypeToStringType = {
415
+ [key in ServiceType]: string;
416
+ };
417
+ export const ServiceTypeToString: ServiceTypeToStringType = {
418
+ [ServiceType.Volunteer]: "/servicesDefault.webp",
419
+ [ServiceType.EventService]: "/servicesDefault.webp",
420
+ [ServiceType.EntertainmentService]: "/servicesDefault.webp",
421
+ [ServiceType.Vendor]: "/servicesDefault.webp",
422
+ [ServiceType.Exhibitor]: "/servicesDefault.webp",
423
+ [ServiceType.Sponsor]: "/servicesDefault.webp",
424
+ [ServiceType.Venue]: "/servicesDefault.webp",
425
+ [ServiceType.Organization]: "/servicesDefault.webp"
426
+ }
427
+
413
428
  export type RecordKey = string | number | symbol;
414
429
  export type PartialExcept<T, K extends keyof T> = Partial<T> & {[P in K]: T[P]};
415
430
  type GetTypeOfArray<T> = T extends (infer U)[] ? U : never;
@@ -214,7 +214,13 @@ export interface ServiceExt extends Service {
214
214
  serviceRange: ServiceRange;
215
215
  targetAudience: TargetAudience;
216
216
  serviceLinks?: ServiceLinkExt[];
217
- venues: VenueExt[];
217
+ venues?: Venue[];
218
+ eventServices?: EventService[];
219
+ entertainmentServices?: EntertainmentService[];
220
+ vendor?: Vendor[];
221
+ exhibitor?: Exhibitor[];
222
+ sponsor?: Sponsor[];
223
+ organization?: Organization[];
218
224
  }
219
225
 
220
226
  export interface ServiceLinkExt extends ServiceLink {