@bash-app/bash-common 16.1.0 → 17.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": "16.1.0",
3
+ "version": "17.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",
@@ -196,16 +196,16 @@ model Invitation {
196
196
  }
197
197
 
198
198
  model BashEvent {
199
- id String @id @default(cuid())
199
+ id String @id @default(cuid())
200
200
  title String
201
201
  creatorId String
202
- creator User @relation("CreatedEvent", fields: [creatorId], references: [id], onDelete: Cascade)
202
+ creator User @relation("CreatedEvent", fields: [creatorId], references: [id], onDelete: Cascade)
203
203
  description String?
204
- eventType String @default("Other")
205
- startDateTime DateTime? @default(now())
206
- endDateTime DateTime? @default(now())
204
+ eventType String @default("Other")
205
+ startDateTime DateTime? @default(now())
206
+ endDateTime DateTime? @default(now())
207
207
  ticketTiers TicketTier[]
208
- targetAudience TargetAudience?
208
+ targetAudience BashTargetAudience?
209
209
  amountOfGuests AmountOfGuests?
210
210
  recurrence Recurrence?
211
211
  vibe String?
@@ -215,18 +215,18 @@ model BashEvent {
215
215
  notAllowed String?
216
216
  nonProfit Boolean?
217
217
  nonProfitId String?
218
- privacy Privacy @default(Public)
218
+ privacy Privacy @default(Public)
219
219
  tickets Ticket[]
220
220
  reviews Review[]
221
221
  sponsorships SponsoredEvent[]
222
222
  investments Investment[]
223
223
  capacity Int?
224
224
  location String?
225
- status BashStatus @default(Draft)
225
+ status BashStatus @default(Draft)
226
226
  tags String[]
227
227
  coverPhoto String?
228
228
  media Media[]
229
- club Club? @relation(fields: [clubId], references: [id], onDelete: SetNull)
229
+ club Club? @relation(fields: [clubId], references: [id], onDelete: SetNull)
230
230
  clubId String?
231
231
  links EventLink[]
232
232
  competitions Competition[]
@@ -499,7 +499,7 @@ enum Privacy {
499
499
  InviteOnly
500
500
  }
501
501
 
502
- model TargetAudience {
502
+ model BashTargetAudience {
503
503
  id String @id @default(cuid())
504
504
  bashEventId String @unique
505
505
  bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
@@ -508,6 +508,8 @@ model TargetAudience {
508
508
  occupation Occupation @default(NoPreference)
509
509
  education Education @default(NoPreference)
510
510
  showOnDetailPage Boolean @default(true)
511
+
512
+ @@map("TargetAudience")
511
513
  }
512
514
 
513
515
  model ServiceTargetAudience {
@@ -517,8 +519,16 @@ model ServiceTargetAudience {
517
519
  occupation Occupation @default(NoPreference)
518
520
  education Education @default(NoPreference)
519
521
  showOnDetailPage Boolean @default(true)
520
- Venue Venue? @relation(fields: [venueId], references: [id])
521
- venueId String?
522
+ }
523
+
524
+ model VenueTargetAudience {
525
+ id String @id @default(cuid())
526
+ ageRange AgeRange @default(NoPreference)
527
+ gender Gender @default(NoPreference)
528
+ occupation Occupation @default(NoPreference)
529
+ education Education @default(NoPreference)
530
+ showOnDetailPage Boolean @default(true)
531
+ venue Venue? @relation("VenueTargetAudience")
522
532
  }
523
533
 
524
534
  enum AgeRange {
@@ -632,7 +642,7 @@ model Media {
632
642
  businessesReferencingMe Business[]
633
643
  sponsoredEventsReferencingMe SponsoredEvent[]
634
644
  servicesReferencingMe Service[]
635
- venueReferencingMe Venue[]
645
+ venueReferencingMe Venue[]
636
646
  }
637
647
 
638
648
  enum MediaType {
@@ -836,8 +846,8 @@ model Service {
836
846
  }
837
847
 
838
848
  model Venue {
839
- id String @id @default(cuid())
840
- service Service? @relation(fields: [serviceId], references: [id])
849
+ id String @id @default(cuid())
850
+ service Service? @relation(fields: [serviceId], references: [id])
841
851
  serviceId String?
842
852
  venueName String
843
853
  email String
@@ -847,15 +857,15 @@ model Venue {
847
857
  postalCode String
848
858
  country String
849
859
  phone String
850
- coverPhoto String?
851
- media Media[]
852
- visibility VisibilityPreference @default(Public)
860
+ coverPhoto String?
861
+ media Media[]
862
+ visibility VisibilityPreference @default(Public)
853
863
  capacity Int?
854
864
  amenities String[]
855
865
  additionalInfo String?
856
866
  features String[]
857
867
  venueTypes String[]
858
- availableDateTimes Availability[] @relation("AvailableDateTimes")
868
+ availableDateTimes Availability[] @relation("AvailableDateTimes")
859
869
  // specialDateTimes Availability[] @relation("SpecialDateTimes")
860
870
  mission String?
861
871
  pitch String?
@@ -866,10 +876,11 @@ model Venue {
866
876
  cancellationPolicy String?
867
877
  refundPolicy String?
868
878
  safetyPolicy String?
869
- crowdSizeId String @unique
870
- crowdSize ServiceRange @relation("CrowdSize", fields: [crowdSizeId], references: [id], onDelete: Cascade)
871
- serviceTargetAudience ServiceTargetAudience[]
879
+ crowdSizeId String @unique
880
+ crowdSize ServiceRange @relation("CrowdSize", fields: [crowdSizeId], references: [id], onDelete: Cascade)
881
+ targetAudience VenueTargetAudience @relation("VenueTargetAudience", fields: [venueTargetAudienceId], references: [id])
872
882
  bashesInterestedIn BashEventType[]
883
+ venueTargetAudienceId String @unique
873
884
  }
874
885
 
875
886
  enum ServiceTag {
@@ -4,7 +4,7 @@ import {
4
4
  AssociatedBash,
5
5
  BashEvent,
6
6
  Invitation,
7
- TargetAudience,
7
+ BashTargetAudience,
8
8
  Ticket,
9
9
  User,
10
10
  TicketTier, Service, Review, Media, BashComment, Recurrence, Contact,
@@ -14,6 +14,7 @@ import {
14
14
  Checkout,
15
15
  ServiceLink,
16
16
  Link, Venue, Availability,
17
+ VenueTargetAudience,
17
18
  } from "@prisma/client";
18
19
 
19
20
  export const FRONT_END_USER_DATA_TO_SELECT = {
@@ -37,7 +38,7 @@ export const PRIVATE_USER_ACCOUNT_TO_SELECT = {
37
38
  }
38
39
 
39
40
  export interface BashEventExt extends BashEvent {
40
- targetAudience?: TargetAudience;
41
+ targetAudience?: BashTargetAudience;
41
42
  amountOfGuests?: AmountOfGuests;
42
43
  recurrence?: Recurrence;
43
44
  creator?: PublicUser;
@@ -125,11 +126,13 @@ export const BASH_EVENT_DATA_TO_REMOVE: RemoveCommonProperties<BashEvent, BashEv
125
126
  export interface VenueExt extends Venue {
126
127
  service: Service;
127
128
  availableDateTimes: Availability[];
129
+ targetAudience: VenueTargetAudience;
128
130
  }
129
131
 
130
132
  export const VENUE_DATA_TO_INCLUDE = {
131
133
  service: true,
132
134
  availableDateTimes: true,
135
+ targetAudience: true,
133
136
  }
134
137
 
135
138
  export interface ServiceExt extends Service {