@bash-app/bash-common 10.3.0 → 10.4.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": "10.3.0",
3
+ "version": "10.4.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",
@@ -631,6 +631,7 @@ model Media {
631
631
  businessesReferencingMe Business[]
632
632
  sponsoredEventsReferencingMe SponsoredEvent[]
633
633
  servicesReferencingMe Service[]
634
+ contactMedia ContactMedia[]
634
635
  }
635
636
 
636
637
  enum MediaType {
@@ -784,10 +785,21 @@ model Contact {
784
785
  requestToConnectSent DateTime?
785
786
  requestToConnectAccepted DateTime?
786
787
 
788
+ media ContactMedia[]
789
+
787
790
  @@unique([contactOwnerId, email])
788
791
  @@index([email])
789
792
  }
790
793
 
794
+ model ContactMedia {
795
+ contactId String
796
+ mediaId String
797
+ contact Contact @relation(fields: [contactId], references: [id], onDelete: Cascade)
798
+ media Media @relation(fields: [mediaId], references: [id], onDelete: Cascade)
799
+
800
+ @@id([contactId, mediaId])
801
+ }
802
+
791
803
  model AssociatedBash {
792
804
  id String @id @default(cuid())
793
805
  bashEventId String
@@ -204,6 +204,19 @@ export interface ReviewExt extends Review {
204
204
  comments: BashComment[];
205
205
  }
206
206
 
207
+ export interface ContactExt extends Contact {
208
+ user: User;
209
+ media: Media[];
210
+ }
211
+
212
+ export const CONTACT_DATA_TO_INCLUDE = {
213
+ user: {
214
+ select: FRONT_END_USER_DATA_TO_SELECT
215
+ },
216
+ media: true
217
+ };
218
+
219
+
207
220
  export interface UserExtraData extends User {
208
221
  password?: string;
209
222
  otp?: string;