@bash-app/bash-common 29.18.4 → 29.18.5

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.18.4",
3
+ "version": "29.18.5",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -12,7 +12,7 @@ import {
12
12
  User,
13
13
  YearsOfExperience
14
14
  } from "@prisma/client";
15
- import { ServiceExt, CheckoutExt, PublicUser, VolunteerServiceExt} from "./extendedSchemas";
15
+ import { ServiceExt, CheckoutExt, PublicUser, VolunteerServiceExt, SERVICE_DATA_TO_INCLUDE} from "./extendedSchemas";
16
16
 
17
17
  export const PASSWORD_MIN_LENGTH = 10 as const;
18
18
  export const PASSWORD_REQUIREMENTS_REGEX = new RegExp(String.raw`^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{${PASSWORD_MIN_LENGTH},}$`);
@@ -77,6 +77,7 @@ export const DEFAULT_PRISMA_TTL_SECONDS = 60 as const;
77
77
  export const PRISMA_MEDIA_TTL_SECONDS = 60 * 5; // 5 hours
78
78
  export const PRISMA_USER_TTL_SECONDS = 60 * 7; // 7 hours
79
79
  export const PRISMA_BASH_EVENT_TTL_SECONDS = 60 as const;
80
+ export const PRISMA_SERVICE_TTL_SECONDS = 60 as const;
80
81
 
81
82
  export const MIN_PASSWORD_LENGTH = 10 as const;
82
83
 
@@ -92,16 +93,16 @@ export const SERVICE_LINK_DATA_TO_INCLUDE = {
92
93
  link: true,
93
94
  } satisfies Prisma.ServiceLinkInclude;
94
95
 
95
- export const SERVICE_DATA_TO_INCLUDE = {
96
- stripeAccount: true,
97
- availableDateTimes: true,
98
- targetAudience: true,
99
- media: true,
100
- serviceLinks: {
101
- include: SERVICE_LINK_DATA_TO_INCLUDE
102
- },
103
- // googleReviews: true,
104
- } satisfies Prisma.ServiceInclude;
96
+ // export const SERVICE_DATA_TO_INCLUDE = {
97
+ // stripeAccount: true,
98
+ // availableDateTimes: true,
99
+ // targetAudience: true,
100
+ // media: true,
101
+ // serviceLinks: {
102
+ // include: SERVICE_LINK_DATA_TO_INCLUDE
103
+ // },
104
+ // // googleReviews: true,
105
+ // } satisfies Prisma.ServiceInclude;
105
106
 
106
107
  // export type ServiceSpecificName = keyof Pick<
107
108
  // ServiceExt,
@@ -29,7 +29,7 @@ import {
29
29
  Rate,
30
30
  GoogleReview,
31
31
  } from "@prisma/client";
32
- import { UnionFromArray } from "./definitions";
32
+ import { SERVICE_LINK_DATA_TO_INCLUDE, UnionFromArray } from "./definitions";
33
33
 
34
34
  export const FRONT_END_USER_DATA_TO_SELECT = {
35
35
  id: true,
@@ -100,6 +100,25 @@ export const BASH_EVENT_DATA_TO_REMOVE: RemoveCommonProperties<BashEvent, BashEv
100
100
  'amountOfGuests',
101
101
  ];
102
102
 
103
+ export const SERVICE_DATA_TO_INCLUDE = {
104
+ creator: {
105
+ select: FRONT_END_USER_DATA_TO_SELECT
106
+ },
107
+ targetAudience: true,
108
+ // amountOfGuests: true,
109
+ // recurrence: true,
110
+ // ticketTiers: {
111
+ // include: TICKET_TIER_DATA_TO_INCLUDE
112
+ // },
113
+ // eventTasks: true,
114
+ media: true,
115
+ stripeAccount: true,
116
+ availableDateTimes: true,
117
+ serviceLinks: {
118
+ include: SERVICE_LINK_DATA_TO_INCLUDE
119
+ },
120
+ } satisfies Prisma.ServiceInclude;
121
+
103
122
  export interface BashNotificationExt extends BashNotification {
104
123
  creator?: PublicUser;
105
124
  bashEvent?: BashEvent;
@@ -272,6 +291,15 @@ export const ASSOCIATED_BASH_DATA_TO_INCLUDE = {
272
291
  }
273
292
  } satisfies Prisma.AssociatedBashInclude;
274
293
 
294
+ export const ASSOCIATED_SERVICE_DATA_TO_INCLUDE = {
295
+ service: {
296
+ include: SERVICE_DATA_TO_INCLUDE
297
+ },
298
+ // invitation: {
299
+ // include: INVITATION_DATA_TO_INCLUDE
300
+ // }
301
+ } satisfies Prisma.AssociatedServiceInclude;
302
+
275
303
  export interface TicketTierExt extends TicketTier {
276
304
  bashEvent: BashEvent;
277
305
  tickets: TicketExt[];