@bash-app/bash-common 29.21.22 → 29.21.24

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.21.22",
3
+ "version": "29.21.24",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -726,6 +726,8 @@ model Media {
726
726
  serviceReferencingMe Service[]
727
727
  volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id])
728
728
  volunteerServiceId String?
729
+
730
+ stripeAccount StripeAccount[]
729
731
  }
730
732
 
731
733
  enum MediaType {
@@ -934,7 +936,7 @@ model AssociatedService {
934
936
  model Service {
935
937
  id String @id @default(cuid())
936
938
 
937
- serviceType ServiceTypes
939
+ serviceType ServiceTypes?
938
940
  serviceStatus ServiceStatus @default(Draft)
939
941
  serviceCondition ServiceCondition @default(Pending)
940
942
 
@@ -947,7 +949,7 @@ model Service {
947
949
  creator User? @relation("CreatedService", fields: [creatorId], references: [id])
948
950
 
949
951
  createdAt DateTime @default(now())
950
- updatedAt DateTime @updatedAt
952
+ updatedAt DateTime? @updatedAt
951
953
 
952
954
  associatedBashesReferencingMe AssociatedBash[]
953
955
  associatedServicesReferencingMe AssociatedService[]
@@ -1018,10 +1020,13 @@ model StripeAccount {
1018
1020
  id String @id @default(cuid())
1019
1021
 
1020
1022
  ownerId String
1021
- owner User @relation(fields: [ownerId], references: [id])
1023
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Restrict)
1022
1024
 
1023
1025
  stripeAccountId String
1024
1026
 
1027
+ logoId String?
1028
+ logo Media? @relation(fields: [logoId], references: [id], onDelete: SetNull)
1029
+
1025
1030
  createdAt DateTime @default(now())
1026
1031
  updatedAt DateTime @updatedAt
1027
1032
 
@@ -15,7 +15,7 @@ import {
15
15
  import { ServiceExt, CheckoutExt, PublicUser, VolunteerServiceExt, BashEventExt} from "./extendedSchemas";
16
16
 
17
17
  export const PASSWORD_MIN_LENGTH = 10 as const;
18
- export const PASSWORD_REQUIREMENTS_REGEX = new RegExp(String.raw`^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{${PASSWORD_MIN_LENGTH},}$`);
18
+ export const PASSWORD_REQUIREMENTS_REGEX = new RegExp(String.raw`^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&^#])[A-Za-z\d@$!%*?&^#]{${PASSWORD_MIN_LENGTH},}$`);
19
19
  export const BASH_FEE_PERCENTAGE = 0.10;
20
20
  export const GOOGLE_CALLBACK_URL = '/auth/google/callback' as const;
21
21
  export const CHECKOUT_RETURN_SUCCESS_URL = `/checkout-return/success/{CHECKOUT_SESSION_ID}` as const;
@@ -79,7 +79,7 @@ export const PRISMA_USER_TTL_SECONDS = 60 * 7; // 7 hours
79
79
  export const PRISMA_BASH_EVENT_TTL_SECONDS = 60 as const;
80
80
  export const PRISMA_SERVICE_TTL_SECONDS = 60 as const;
81
81
 
82
- export const MIN_PASSWORD_LENGTH = 10 as const;
82
+ export const MIN_PASSWORD_LENGTH = 8 as const;
83
83
 
84
84
  export const DEBOUNCE_WAIT = 1000 as const;
85
85
 
@@ -229,6 +229,16 @@ export interface SignInEmailWithPassword {
229
229
  password: string;
230
230
  }
231
231
 
232
+ export interface ForgotPassword {
233
+ email: string;
234
+ }
235
+
236
+ export interface ResetPassword {
237
+ email: string;
238
+ password: string;
239
+ otp: string;
240
+ }
241
+
232
242
  export interface ApiResult<T, P extends ErrorDataType = ErrorDataType> {
233
243
  data?: T;
234
244
  status?: number;
@@ -307,7 +317,7 @@ export type StripeLinkingStatus = {
307
317
  };
308
318
 
309
319
  export type StripeBusinessDataPublic = {
310
- logo?: string; //not possible to fetch logo directly from stripe
320
+ logoUrl?: string; //not possible to fetch logo directly from stripe
311
321
  businessName?: string;
312
322
  businessNameDBA?: string;
313
323
  supportEmail?: string;
@@ -35,6 +35,7 @@ import {
35
35
  ServiceDailyRates,
36
36
  ServiceSpecialRates,
37
37
  ServiceAddon,
38
+ ServicePackage,
38
39
  } from "@prisma/client";
39
40
  import { SERVICE_LINK_DATA_TO_INCLUDE, UnionFromArray } from "./definitions";
40
41
 
@@ -176,6 +177,32 @@ export const SERVICE_FULL_DATA_TO_INCLUDE = {
176
177
  ...createAllTrueObject(serviceKeysArray)
177
178
  } satisfies Prisma.ServiceInclude;
178
179
 
180
+ export const SERVICE_PACKAGE_DATA_TO_INCLUDE = {
181
+ serviceAddons: true
182
+ } satisfies Prisma.ServicePackageInclude;
183
+
184
+ export const SERVICE_DAILYRATES_DATA_TO_INCLUDE = {
185
+ serviceRate: true
186
+ } satisfies Prisma.ServiceDailyRatesInclude;
187
+
188
+ export const SERVICE_SPECIALRATES_DATA_TO_INCLUDE = {
189
+ serviceRate: true
190
+ } satisfies Prisma.ServiceSpecialRatesInclude;
191
+
192
+ export const SERVICE_RATES_ASSOCIATION_DATA_TO_INCLUDE = {
193
+ serviceGeneralRates: true,
194
+ serviceDailyRates: {
195
+ include: SERVICE_DAILYRATES_DATA_TO_INCLUDE
196
+ },
197
+ serviceSpecialRates: {
198
+ include: SERVICE_SPECIALRATES_DATA_TO_INCLUDE
199
+ },
200
+ addons: true,
201
+ packages: {
202
+ include: SERVICE_PACKAGE_DATA_TO_INCLUDE
203
+ },
204
+ } satisfies Prisma.ServiceRatesAssociationInclude;
205
+
179
206
  export interface BashNotificationExt extends BashNotification {
180
207
  creator?: PublicUser;
181
208
  bashEvent?: BashEvent;
@@ -230,6 +257,16 @@ export const EVENT_TASK_DATA_TO_INCLUDE = {
230
257
  }
231
258
  } satisfies Prisma.EventTaskInclude;
232
259
 
260
+
261
+ //------------Stripe Accounts--------------
262
+ export const STRIPE_ACCOUNT_DATA_TO_INCLUDE = {
263
+ logo: true
264
+ } satisfies Prisma.StripeAccountInclude;
265
+
266
+ export interface StripeAccountExt extends StripeAccount {
267
+ logo?: Media | null;
268
+ }
269
+
233
270
  //---------------Services------------------
234
271
  export interface ServiceExt extends Service {
235
272
  owner?: PublicUser | null;
@@ -252,18 +289,18 @@ export interface ServiceExt extends Service {
252
289
  venue?: Venue;
253
290
  organization?: Organization;
254
291
 
255
- serviceRatesAssociation?: ServiceRatesAssociationExt;
292
+ serviceRatesAssociation?: ServiceRatesAssociationExt | null;
256
293
 
257
294
  // googleReviews: GoogleReview[];
258
295
  }
259
- export interface ServicePackageExt extends ServiceDailyRates {
260
- serviceAddons: ServiceAddon[]
296
+ export interface ServicePackageExt extends ServicePackage {
297
+ serviceAddons: ServiceAddon[];
261
298
  }
262
299
 
263
300
  export interface ServiceDailyRatesExt extends ServiceDailyRates {
264
301
  serviceRate?: ServiceRate;
265
302
  }
266
- export interface ServiceSpecialRatesExt extends ServiceRatesAssociation {
303
+ export interface ServiceSpecialRatesExt extends ServiceSpecialRates {
267
304
  serviceRate?: ServiceRate;
268
305
  }
269
306
 
@@ -271,9 +308,9 @@ export interface ServiceRatesAssociationExt extends ServiceRatesAssociation {
271
308
  serviceGeneralRates?: ServiceRate;
272
309
  serviceDailyRates?: ServiceDailyRates;
273
310
  serviceSpecialRates?: ServiceSpecialRates;
274
-
275
- packages?: ServicePackageExt;
311
+
276
312
  addons: ServiceAddon[];
313
+ packages: ServicePackageExt[];
277
314
  }
278
315
 
279
316