@bash-app/bash-common 27.2.12 → 27.3.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": "27.2.12",
3
+ "version": "27.3.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",
@@ -9,7 +9,7 @@ import {
9
9
  User,
10
10
  YearsOfExperience
11
11
  } from "@prisma/client";
12
- import { CheckoutExt, PublicUser} from "./extendedSchemas";
12
+ import { CheckoutExt, PublicUser, ServiceExt} 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,7 +91,15 @@ 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
-
94
+ export const ServiceTypes = {
95
+ 'EventServices': 'eventServices',
96
+ 'Organizations': 'organizations',
97
+ 'Venues': 'venues',
98
+ 'Vendors': 'vendors',
99
+ 'Sponsors': 'sponsors',
100
+ 'Exhibitors': 'exhibitors',
101
+ 'EntertainmentServices': 'entertainmentServices',
102
+ } satisfies {[key: string]: keyof ServiceExt}
95
103
  export type FilterFields = {
96
104
  price: string[];
97
105
  ageRequirement: string[];
@@ -302,7 +310,18 @@ export const YearsOfExperienceToString: { [key in YearsOfExperience]: string } =
302
310
  [YearsOfExperience.ThreeToFiveYears]: 'Three to five years',
303
311
  [YearsOfExperience.FivePlusYears]: 'More than five years',
304
312
  };
305
-
313
+ export type ServiceTypeToStringType = {
314
+ [key in ValueOf<typeof ServiceTypes>]: string;
315
+ };
316
+ export const ServiceTypeToString: ServiceTypeToStringType = {
317
+ [ServiceTypes.EventServices]: "/servicesDefault.webp",
318
+ [ServiceTypes.EntertainmentServices]: "/servicesDefault.webp",
319
+ [ServiceTypes.Vendors]: "/servicesDefault.webp",
320
+ [ServiceTypes.Exhibitors]: "/servicesDefault.webp",
321
+ [ServiceTypes.Sponsors]: "/servicesDefault.webp",
322
+ [ServiceTypes.Venues]: "/servicesDefault.webp",
323
+ [ServiceTypes.Organizations]: "/servicesDefault.webp"
324
+ }
306
325
  export type BashEventTypeToStringType = {
307
326
  [key in BashEventType]: string;
308
327
  };
@@ -23,6 +23,7 @@ import {
23
23
  Organization,
24
24
  Booking,
25
25
  VolunteerService, Prisma, ServiceRange,
26
+ ServiceTypes,
26
27
  } from "@prisma/client";
27
28
  import {UnionFromArray} from "./definitions";
28
29
 
@@ -272,6 +273,7 @@ targetAudience?: TargetAudience | null;
272
273
  sponsors?: Sponsor[];
273
274
  organizations?: Organization[];
274
275
  bookings?: Booking[];
276
+ serviceType: ServiceTypes;
275
277
  }
276
278
 
277
279