@bash-app/bash-common 27.3.0 → 27.3.2
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/src/definitions.ts +7 -1
- package/src/extendedSchemas.ts +6 -29
package/package.json
CHANGED
package/src/definitions.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
User,
|
|
10
10
|
YearsOfExperience
|
|
11
11
|
} from "@prisma/client";
|
|
12
|
-
import { CheckoutExt, PublicUser,
|
|
12
|
+
import { ServiceExt, CheckoutExt, PublicUser, VolunteerServiceExt} from "./extendedSchemas";
|
|
13
13
|
|
|
14
14
|
export const PASSWORD_MIN_LENGTH = 10 as const;
|
|
15
15
|
export const PASSWORD_REQUIREMENTS_REGEX = new RegExp(String.raw`^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{${PASSWORD_MIN_LENGTH},}$`);
|
|
@@ -91,6 +91,8 @@ export type ContactOrUser = Contact | PublicUser;
|
|
|
91
91
|
export type UnionFromArray<T extends ReadonlyArray<any>> = T[number];
|
|
92
92
|
export type ValueOf<T> = T[keyof T];
|
|
93
93
|
|
|
94
|
+
export type ValueOfServiceType = ValueOf<typeof ServiceTypes>;
|
|
95
|
+
|
|
94
96
|
export const ServiceTypes = {
|
|
95
97
|
'EventServices': 'eventServices',
|
|
96
98
|
'Organizations': 'organizations',
|
|
@@ -100,6 +102,7 @@ export const ServiceTypes = {
|
|
|
100
102
|
'Exhibitors': 'exhibitors',
|
|
101
103
|
'EntertainmentServices': 'entertainmentServices',
|
|
102
104
|
} satisfies {[key: string]: keyof ServiceExt}
|
|
105
|
+
|
|
103
106
|
export type FilterFields = {
|
|
104
107
|
price: string[];
|
|
105
108
|
ageRequirement: string[];
|
|
@@ -304,12 +307,14 @@ export const DayOfWeekToString: { [key in DayOfWeek]: string } = {
|
|
|
304
307
|
[DayOfWeek.Saturday]: 'S',
|
|
305
308
|
}
|
|
306
309
|
|
|
310
|
+
|
|
307
311
|
export const YearsOfExperienceToString: { [key in YearsOfExperience]: string } = {
|
|
308
312
|
[YearsOfExperience.LessThanOneYear]: 'Less than one year',
|
|
309
313
|
[YearsOfExperience.OneToThreeYears]: 'One to three years',
|
|
310
314
|
[YearsOfExperience.ThreeToFiveYears]: 'Three to five years',
|
|
311
315
|
[YearsOfExperience.FivePlusYears]: 'More than five years',
|
|
312
316
|
};
|
|
317
|
+
|
|
313
318
|
export type ServiceTypeToStringType = {
|
|
314
319
|
[key in ValueOf<typeof ServiceTypes>]: string;
|
|
315
320
|
};
|
|
@@ -322,6 +327,7 @@ export const ServiceTypeToString: ServiceTypeToStringType = {
|
|
|
322
327
|
[ServiceTypes.Venues]: "/servicesDefault.webp",
|
|
323
328
|
[ServiceTypes.Organizations]: "/servicesDefault.webp"
|
|
324
329
|
}
|
|
330
|
+
|
|
325
331
|
export type BashEventTypeToStringType = {
|
|
326
332
|
[key in BashEventType]: string;
|
|
327
333
|
};
|
package/src/extendedSchemas.ts
CHANGED
|
@@ -166,6 +166,7 @@ export interface EntertainmentServiceExt extends EntertainmentService {
|
|
|
166
166
|
links: ServiceLinkExt[];
|
|
167
167
|
crowdSize?: AmountOfGuests;
|
|
168
168
|
media?: Media[];
|
|
169
|
+
status: ServiceStatus;
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
export interface ExhibitorExt extends Exhibitor {
|
|
@@ -175,6 +176,7 @@ export interface ExhibitorExt extends Exhibitor {
|
|
|
175
176
|
links: ServiceLinkExt[];
|
|
176
177
|
crowdSize?: AmountOfGuests;
|
|
177
178
|
media?: Media[];
|
|
179
|
+
status: ServiceStatus;
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
export interface SponsorExt extends Sponsor {
|
|
@@ -184,6 +186,7 @@ export interface SponsorExt extends Sponsor {
|
|
|
184
186
|
links: ServiceLinkExt[];
|
|
185
187
|
crowdSize?: AmountOfGuests;
|
|
186
188
|
media?: Media[];
|
|
189
|
+
status: ServiceStatus;
|
|
187
190
|
}
|
|
188
191
|
|
|
189
192
|
export interface VendorExt extends Vendor {
|
|
@@ -193,21 +196,11 @@ export interface VendorExt extends Vendor {
|
|
|
193
196
|
links: ServiceLinkExt[];
|
|
194
197
|
crowdSize?: AmountOfGuests;
|
|
195
198
|
media?: Media[];
|
|
199
|
+
status: ServiceStatus;
|
|
196
200
|
}
|
|
197
201
|
|
|
198
|
-
export const VENDOR_DATA_TO_INCLUDE = {
|
|
199
|
-
availableDateTimes: true,
|
|
200
|
-
targetAudience: true,
|
|
201
|
-
links: true,
|
|
202
|
-
crowdSize: true,
|
|
203
|
-
media: true,
|
|
204
|
-
} satisfies Prisma.VendorInclude;
|
|
205
|
-
|
|
206
|
-
export const SERVICE_LINK_DATA_TO_INCLUDE = {
|
|
207
|
-
link: true,
|
|
208
|
-
} satisfies Prisma.ServiceLinkInclude;
|
|
209
|
-
|
|
210
202
|
export interface VenueExt extends Venue {
|
|
203
|
+
owner: User;
|
|
211
204
|
service?: Service;
|
|
212
205
|
availableDateTimes?: Availability[];
|
|
213
206
|
targetAudience?: TargetAudience | null;
|
|
@@ -215,23 +208,9 @@ export interface VenueExt extends Venue {
|
|
|
215
208
|
coverPhotoUrl?: string;
|
|
216
209
|
media?: Media[];
|
|
217
210
|
amountOfGuests?: AmountOfGuests | null;
|
|
218
|
-
|
|
211
|
+
status: ServiceStatus;
|
|
219
212
|
}
|
|
220
213
|
|
|
221
|
-
|
|
222
|
-
export const VOLUNTEER_DATA_TO_INCLUDE = {
|
|
223
|
-
links: {
|
|
224
|
-
include: {
|
|
225
|
-
serviceLinks: true,
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
media: true,
|
|
229
|
-
serviceRange: true,
|
|
230
|
-
} satisfies Prisma.VolunteerServiceInclude;
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
214
|
export interface OrganizationExt extends Organization {
|
|
236
215
|
service?: Service;
|
|
237
216
|
availableDateTimes: Availability[];
|
|
@@ -256,8 +235,6 @@ export interface VolunteerServiceExt extends VolunteerService {
|
|
|
256
235
|
status: VolunteerServiceStatus | null;
|
|
257
236
|
}
|
|
258
237
|
|
|
259
|
-
|
|
260
|
-
|
|
261
238
|
export interface ServiceExt extends Service {
|
|
262
239
|
owner?: PublicUser;
|
|
263
240
|
media?: Media[];
|