@bash-app/bash-common 20.3.0 → 20.5.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": "20.3.0",
3
+ "version": "20.5.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",
@@ -244,7 +244,6 @@ model BashEvent {
244
244
  subtitle String?
245
245
  isFeatured Boolean?
246
246
  isTrending Boolean?
247
- serviceCheckout ServiceCheckout[]
248
247
  }
249
248
 
250
249
  model Checkout {
@@ -261,17 +260,6 @@ model Checkout {
261
260
  @@index(bashEventId)
262
261
  }
263
262
 
264
- model ServiceCheckout {
265
- id String @id @default(cuid())
266
- ownerId String
267
- owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
268
- bashEventId String
269
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
270
- checkoutDateTime DateTime? @default(now())
271
- tickets Ticket[]
272
- stripeCheckoutSessionId String? @unique
273
- }
274
-
275
263
  model TicketTier {
276
264
  id String @id @default(cuid())
277
265
  bashEventId String
@@ -326,6 +314,37 @@ enum TicketStatus {
326
314
  Missed
327
315
  }
328
316
 
317
+ model ServiceCheckout {
318
+ id String @id @default(cuid())
319
+ ownerId String
320
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
321
+ checkoutDateTime DateTime? @default(now())
322
+ tickets Ticket[]
323
+ stripeCheckoutSessionId String? @unique
324
+ }
325
+
326
+ model UserSubscription {
327
+ id String @id @default(cuid())
328
+ ownerId String @unique
329
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
330
+ type UserSubscriptionType
331
+ }
332
+
333
+ enum UserSubscriptionType {
334
+ Free
335
+ Premium
336
+ VIP
337
+ }
338
+
339
+ model SubServiceSubcription {
340
+ id String @id @default(cuid())
341
+ ownerId String
342
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
343
+ type ServiceType
344
+ slots Int @default(0)
345
+ stripeSubscriptionId String?
346
+ }
347
+
329
348
  enum BookingStatus {
330
349
  Cancelled
331
350
  Completed
@@ -774,11 +793,11 @@ enum SponsorType {
774
793
  }
775
794
 
776
795
  model User {
777
- id String @id @default(cuid())
778
- email String @unique
779
- createdOn DateTime @default(now())
780
- stripeCustomerId String? @unique
781
- stripeAccountId String? @unique
796
+ id String @id @default(cuid())
797
+ email String @unique
798
+ createdOn DateTime @default(now())
799
+ stripeCustomerId String? @unique
800
+ stripeAccountId String? @unique
782
801
  googleCalendarAccess String?
783
802
  givenName String?
784
803
  familyName String?
@@ -789,11 +808,11 @@ model User {
789
808
  dob DateTime?
790
809
  gender Gender?
791
810
  sex Sex?
792
- roles UserRole[] @default([User])
811
+ roles UserRole[] @default([User])
793
812
  services Service[]
794
- createdEvents BashEvent[] @relation("CreatedEvent")
795
- ticketsISent Ticket[] @relation("TicketsISent")
796
- ticketsIOwn Ticket[] @relation("TicketsIOwn")
813
+ createdEvents BashEvent[] @relation("CreatedEvent")
814
+ ticketsISent Ticket[] @relation("TicketsISent")
815
+ ticketsIOwn Ticket[] @relation("TicketsIOwn")
797
816
  reviews Review[]
798
817
  sponsorships SponsoredEvent[]
799
818
  investments Investment[]
@@ -816,24 +835,26 @@ model User {
816
835
  city String?
817
836
  state String?
818
837
  postalCode String?
819
- country String? @default("US")
838
+ country String? @default("US")
820
839
  phone String?
821
- documentIDId String? @unique
840
+ documentIDId String? @unique
822
841
  documentID DocumentID?
823
842
  comment BashComment[]
824
843
  associatedBashes AssociatedBash[]
825
- invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
826
- invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
827
- notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
828
- remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
829
- remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
830
- eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
844
+ invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
845
+ invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
846
+ notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
847
+ remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
848
+ remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
849
+ eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
831
850
  checkouts Checkout[]
832
851
  ticketTiersWaitListsIveJoined TicketTier[]
833
852
  contacts Contact[]
834
853
  bashEventPromoCodesIUsed BashEventPromoCode[]
835
854
  ServiceCheckout ServiceCheckout[]
836
855
  bookingForMe Booking[]
856
+ bashSubscription UserSubscription?
857
+ subServiceSubcriptions SubServiceSubcription[]
837
858
  }
838
859
 
839
860
  model Contact {
@@ -866,51 +887,51 @@ model AssociatedBash {
866
887
  }
867
888
 
868
889
  model Service {
869
- id String @id @default(cuid())
870
- ownerId String
871
- owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
872
- dateCreated DateTime @default(now())
873
- email String
874
- location String?
875
- streetAddress String
876
- city String
877
- state String
878
- postalCode String
879
- country String
880
- phone String
881
- name String @default("New Service")
882
- coverPhoto String?
883
- agreedToAgreement Boolean?
884
- media Media[]
885
- serviceTypes ServiceType[]
886
- customServiceTag String[]
887
- yearsOfExperince YearsOfExperience @default(LessThanOneYear)
888
- serviceLinks ServiceLink[]
889
- description String?
890
- canContact Boolean?
890
+ id String @id @default(cuid())
891
+ ownerId String
892
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
893
+ dateCreated DateTime @default(now())
894
+ email String
895
+ location String?
896
+ streetAddress String
897
+ city String
898
+ state String
899
+ postalCode String
900
+ country String
901
+ phone String
902
+ name String @default("New Service")
903
+ coverPhoto String?
904
+ agreedToAgreement Boolean?
905
+ media Media[]
906
+ serviceTypes ServiceType[]
907
+ customServiceTag String[]
908
+ yearsOfExperince YearsOfExperience @default(LessThanOneYear)
909
+ serviceLinks ServiceLink[]
910
+ description String?
911
+ canContact Boolean?
891
912
  // musicGenre MusicGenreType?
892
- visibility VisibilityPreference @default(Public)
913
+ visibility VisibilityPreference @default(Public)
893
914
  // bashesInterestedIn BashEventType[]
894
- status ServiceStatus @default(Draft)
895
- venues Venue[]
896
- serviceRangeId String @unique
897
- serviceRange ServiceRange @relation("ServiceRange", fields: [serviceRangeId], references: [id], onDelete: Cascade)
898
- targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
899
- targetAudienceId String? @unique
900
- eventService EventService[]
901
- entertainmentService EntertainmentService[]
902
- vendor Vendor[]
903
- exhibitor Exhibitor[]
904
- sponsor Sponsor[]
905
- organization Organization[]
906
- trademark String?
907
- manager String?
908
- dba String?
909
- contactPerson String?
910
- contactPhone String?
911
- contactEmail String?
912
- businessPhone String?
913
- bookings Booking[]
915
+ status ServiceStatus @default(Draft)
916
+ venues Venue[]
917
+ serviceRangeId String @unique
918
+ serviceRange ServiceRange @relation("ServiceRange", fields: [serviceRangeId], references: [id], onDelete: Cascade)
919
+ targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
920
+ targetAudienceId String? @unique
921
+ eventServices EventService[]
922
+ entertainmentServices EntertainmentService[]
923
+ vendors Vendor[]
924
+ exhibitor Exhibitor[]
925
+ sponsors Sponsor[]
926
+ organizations Organization[]
927
+ trademark String?
928
+ manager String?
929
+ dba String?
930
+ contactPerson String?
931
+ contactPhone String?
932
+ contactEmail String?
933
+ businessPhone String?
934
+ bookings Booking[]
914
935
 
915
936
  @@index([email])
916
937
  @@index([phone])
@@ -21,6 +21,7 @@ import {
21
21
  Sponsor,
22
22
  Organization,
23
23
  Booking,
24
+ ServiceType,
24
25
  } from "@prisma/client";
25
26
 
26
27
  export const FRONT_END_USER_DATA_TO_SELECT = {
@@ -202,6 +203,14 @@ export const VENUE_DATA_TO_INCLUDE = {
202
203
  capacity: true,
203
204
  media: true,
204
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
+ }
205
214
 
206
215
  export interface ServiceExt extends Service {
207
216
  owner: PublicUser;
@@ -212,11 +221,12 @@ export interface ServiceExt extends Service {
212
221
  venues?: Venue[];
213
222
  eventServices?: EventService[];
214
223
  entertainmentServices?: EntertainmentService[];
215
- vendor?: Vendor[];
216
- exhibitor?: Exhibitor[];
217
- sponsor?: Sponsor[];
218
- organization?: Organization[];
224
+ vendors?: Vendor[];
225
+ exhibitors?: Exhibitor[];
226
+ sponsors?: Sponsor[];
227
+ organizations?: Organization[];
219
228
  bookings?: Booking[];
229
+ serviceTypes: ServiceType[];
220
230
  }
221
231
 
222
232
  export interface ServiceLinkExt extends ServiceLink {
@@ -239,6 +249,9 @@ export const SERVICE_DATA_TO_INCLUDE = {
239
249
  },
240
250
  venues: {
241
251
  include: VENUE_DATA_TO_INCLUDE
252
+ },
253
+ vendors: {
254
+ include: VENDOR_DATA_TO_INCLUDE
242
255
  }
243
256
  }
244
257