@bash-app/bash-common 29.18.3 → 29.18.4

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": "29.18.3",
3
+ "version": "29.18.4",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -882,6 +882,7 @@ model User {
882
882
  documentID DocumentID?
883
883
  comment BashComment[]
884
884
  associatedBashes AssociatedBash[]
885
+ associatedServices AssociatedService[]
885
886
  invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
886
887
  invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
887
888
  notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
@@ -929,6 +930,21 @@ model AssociatedBash {
929
930
  @@unique([ownerEmail, bashEventId])
930
931
  }
931
932
 
933
+ model AssociatedService {
934
+ id String @id @default(cuid())
935
+ serviceId String
936
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
937
+ // referralId String? @unique
938
+ // referral Referral? @relation(fields: [referralId], references: [id])
939
+ ownerEmail String?
940
+ ownerUserId String?
941
+ owner User? @relation(fields: [ownerUserId], references: [id], onDelete: Cascade)
942
+ isOrganizer Boolean?
943
+ isFavorite Boolean?
944
+
945
+ @@unique([ownerEmail, serviceId])
946
+ }
947
+
932
948
  //Common data for all services; 1-1 relation between each individual service model such as Venue
933
949
  model Service {
934
950
  id String @id @default(cuid())
@@ -948,6 +964,8 @@ model Service {
948
964
  createdAt DateTime @default(now())
949
965
  updatedAt DateTime @updatedAt
950
966
 
967
+ associatedServicesReferencingMe AssociatedService[]
968
+
951
969
  serviceName String?
952
970
  tagline String?
953
971
 
@@ -2,6 +2,7 @@ import {
2
2
  AmountOfGuests,
3
3
  EventTask,
4
4
  AssociatedBash,
5
+ AssociatedService,
5
6
  BashEvent,
6
7
  Invitation,
7
8
  Ticket,
@@ -257,6 +258,11 @@ export interface AssociatedBashExt extends AssociatedBash {
257
258
  invitation: InvitationExt;
258
259
  }
259
260
 
261
+ export interface AssociatedServiceExt extends AssociatedService {
262
+ service: ServiceExt;
263
+ // invitation: InvitationExt;
264
+ }
265
+
260
266
  export const ASSOCIATED_BASH_DATA_TO_INCLUDE = {
261
267
  bashEvent: {
262
268
  include: BASH_EVENT_DATA_TO_INCLUDE