@bash-app/bash-common 3.4.0 → 4.0.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 +6 -6
- package/src/extendedSchemas.ts +15 -13
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -783,7 +783,7 @@ model Service {
|
|
|
783
783
|
title String?
|
|
784
784
|
coverPhoto String?
|
|
785
785
|
media Media[]
|
|
786
|
-
|
|
786
|
+
serviceTypes ServiceType[]
|
|
787
787
|
subServiceType String?
|
|
788
788
|
serviceLinks ServiceLink[]
|
|
789
789
|
description String?
|
|
@@ -799,11 +799,11 @@ model Service {
|
|
|
799
799
|
}
|
|
800
800
|
|
|
801
801
|
model ServiceRange {
|
|
802
|
-
id
|
|
803
|
-
min
|
|
804
|
-
max
|
|
805
|
-
|
|
806
|
-
|
|
802
|
+
id String @id @default(cuid())
|
|
803
|
+
min Int @default(0)
|
|
804
|
+
max Int @default(50)
|
|
805
|
+
serviceCrowdSize Service? @relation("CrowdSize")
|
|
806
|
+
serviceServiceRange Service? @relation("ServiceRange")
|
|
807
807
|
}
|
|
808
808
|
|
|
809
809
|
model Availability {
|
package/src/extendedSchemas.ts
CHANGED
|
@@ -12,6 +12,17 @@ import {
|
|
|
12
12
|
Reminder, ServiceRange
|
|
13
13
|
} from "@prisma/client";
|
|
14
14
|
|
|
15
|
+
export const FRONT_END_USER_DATA_TO_SELECT = {
|
|
16
|
+
id: true,
|
|
17
|
+
email: true,
|
|
18
|
+
givenName: true,
|
|
19
|
+
familyName: true,
|
|
20
|
+
fullName: true,
|
|
21
|
+
username: true,
|
|
22
|
+
image: true,
|
|
23
|
+
uploadedImage: true,
|
|
24
|
+
services: true,
|
|
25
|
+
}
|
|
15
26
|
|
|
16
27
|
export interface BashEventExt extends BashEvent {
|
|
17
28
|
targetAudience?: TargetAudience;
|
|
@@ -74,7 +85,9 @@ export interface ServiceExt extends Service {
|
|
|
74
85
|
}
|
|
75
86
|
|
|
76
87
|
export const SERVICE_DATA_TO_INCLUDE = {
|
|
77
|
-
owner:
|
|
88
|
+
owner: {
|
|
89
|
+
select: FRONT_END_USER_DATA_TO_SELECT
|
|
90
|
+
},
|
|
78
91
|
media: true,
|
|
79
92
|
crowdSize: true,
|
|
80
93
|
serviceRange: true,
|
|
@@ -151,17 +164,6 @@ export const USER_DATA_SELECT_REVIEWS_COMMENTS = {
|
|
|
151
164
|
}
|
|
152
165
|
}
|
|
153
166
|
|
|
154
|
-
export const PUBLIC_USER_DATA_TO_SELECT = {
|
|
155
|
-
id: true,
|
|
156
|
-
email: true,
|
|
157
|
-
givenName: true,
|
|
158
|
-
familyName: true,
|
|
159
|
-
fullName: true,
|
|
160
|
-
username: true,
|
|
161
|
-
image: true,
|
|
162
|
-
uploadedImage: true,
|
|
163
|
-
services: true,
|
|
164
|
-
}
|
|
165
167
|
|
|
166
|
-
export type Public_User = Pick<UserExt, keyof typeof
|
|
168
|
+
export type Public_User = Pick<UserExt, keyof typeof FRONT_END_USER_DATA_TO_SELECT>
|
|
167
169
|
& Partial<Pick<UserExt, keyof typeof USER_DATA_SELECT_REVIEWS_COMMENTS>>;
|