@bash-app/bash-common 10.2.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 +1 -1
- package/prisma/schema.prisma +13 -0
- package/src/extendedSchemas.ts +14 -1
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -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
|
|
@@ -835,6 +847,7 @@ model Service {
|
|
|
835
847
|
serviceRange ServiceRange @relation("ServiceRange", fields: [serviceRangeId], references: [id], onDelete: Cascade)
|
|
836
848
|
availableDateTimes String[] /// Stored in format: ["startDateTime,endDateTime",...]
|
|
837
849
|
serviceTargetAudience ServiceTargetAudience[]
|
|
850
|
+
status ServiceStatus @default(Draft)
|
|
838
851
|
|
|
839
852
|
@@index([email])
|
|
840
853
|
@@index([phone])
|
package/src/extendedSchemas.ts
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
ServiceTargetAudience,
|
|
14
14
|
Checkout,
|
|
15
15
|
ServiceLink,
|
|
16
|
-
Link
|
|
16
|
+
Link,
|
|
17
17
|
} from "@prisma/client";
|
|
18
18
|
|
|
19
19
|
export const FRONT_END_USER_DATA_TO_SELECT = {
|
|
@@ -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;
|