@bash-app/bash-common 29.13.0 → 29.14.1

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": "29.13.0",
3
+ "version": "29.14.1",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -917,9 +917,9 @@ model AssociatedBash {
917
917
  model Service {
918
918
  id String @id @default(cuid())
919
919
 
920
- serviceType ServiceTypes
921
- serviceStatus ServiceStatus @default(Draft)
922
- serviceCondtion ServiceCondition @default(Pending)
920
+ serviceType ServiceTypes
921
+ serviceStatus ServiceStatus @default(Draft)
922
+ serviceCondition ServiceCondition @default(Pending)
923
923
 
924
924
  //current owner
925
925
  ownerId String?
@@ -6,6 +6,7 @@ import {
6
6
  DayOfWeek,
7
7
  Prisma,
8
8
  Rate,
9
+ ServiceTypes,
9
10
  Ticket,
10
11
  TicketTier,
11
12
  User,
@@ -515,7 +516,6 @@ type AllKeysUnion<T> = T extends object
515
516
  export type AllKeys<T> = AllKeysUnion<T>[];
516
517
 
517
518
 
518
-
519
519
  export interface IAddress {
520
520
  place?: string;
521
521
  street: string;
@@ -524,3 +524,30 @@ export interface IAddress {
524
524
  zipCode: string;
525
525
  country: string;
526
526
  }
527
+
528
+ export type ServiceSpecificName = keyof Pick<
529
+ ServiceExt,
530
+ "eventService" |
531
+ "entertainmentService" |
532
+ "vendor" |
533
+ "exhibitor" |
534
+ "sponsor" |
535
+ "venue" |
536
+ "organization"
537
+ >;
538
+
539
+ export type ServiceSpecificType = ServiceExt[ServiceSpecificName];
540
+
541
+ export const serviceTypeToField = (serviceType : ServiceTypes) : ServiceSpecificName => {
542
+ const specificServiceMap : Record<ServiceTypes, ServiceSpecificName> = {
543
+ "EventServices": "eventService",
544
+ "EntertainmentServices": "entertainmentService",
545
+ "Vendors": "vendor",
546
+ "Exhibitors": "exhibitor",
547
+ "Sponsors": "sponsor",
548
+ "Venues": "venue",
549
+ "Organizations": "organization"
550
+ };
551
+
552
+ return specificServiceMap[serviceType];
553
+ }