@bash-app/bash-common 29.14.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 +1 -1
- package/src/definitions.ts +28 -1
package/package.json
CHANGED
package/src/definitions.ts
CHANGED
|
@@ -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
|
+
}
|