@bash-app/bash-common 29.20.22 → 29.21.23
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/prisma/schema.prisma +12 -7
- package/src/definitions.ts +12 -2
- package/src/extendedSchemas.ts +45 -3
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -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
|
|
|
@@ -1382,10 +1387,10 @@ model ServiceSpecialRates {
|
|
|
1382
1387
|
// can have special rates on different days of the year (single or range)
|
|
1383
1388
|
// free trial period with promo code (1 or 2 months of listing for free)
|
|
1384
1389
|
model ServiceDailyRates {
|
|
1385
|
-
id
|
|
1386
|
-
dayOfWeek
|
|
1387
|
-
|
|
1388
|
-
|
|
1390
|
+
id String @id @default(cuid())
|
|
1391
|
+
dayOfWeek Int
|
|
1392
|
+
startTime DateTime @db.Time
|
|
1393
|
+
endTime DateTime @db.Time
|
|
1389
1394
|
|
|
1390
1395
|
serviceRateId String?
|
|
1391
1396
|
serviceRate ServiceRate? @relation(fields: [serviceRateId], references: [id], onDelete: Cascade)
|
package/src/definitions.ts
CHANGED
|
@@ -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 =
|
|
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
|
-
|
|
320
|
+
logoUrl?: string; //not possible to fetch logo directly from stripe
|
|
311
321
|
businessName?: string;
|
|
312
322
|
businessNameDBA?: string;
|
|
313
323
|
supportEmail?: string;
|
package/src/extendedSchemas.ts
CHANGED
|
@@ -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,16 +289,18 @@ export interface ServiceExt extends Service {
|
|
|
252
289
|
venue?: Venue;
|
|
253
290
|
organization?: Organization;
|
|
254
291
|
|
|
292
|
+
serviceRatesAssociation?: ServiceRatesAssociationExt | null;
|
|
293
|
+
|
|
255
294
|
// googleReviews: GoogleReview[];
|
|
256
295
|
}
|
|
257
|
-
export interface ServicePackageExt extends
|
|
258
|
-
serviceAddons: ServiceAddon[]
|
|
296
|
+
export interface ServicePackageExt extends ServicePackage {
|
|
297
|
+
serviceAddons: ServiceAddon[];
|
|
259
298
|
}
|
|
260
299
|
|
|
261
300
|
export interface ServiceDailyRatesExt extends ServiceDailyRates {
|
|
262
301
|
serviceRate?: ServiceRate;
|
|
263
302
|
}
|
|
264
|
-
export interface ServiceSpecialRatesExt extends
|
|
303
|
+
export interface ServiceSpecialRatesExt extends ServiceSpecialRates {
|
|
265
304
|
serviceRate?: ServiceRate;
|
|
266
305
|
}
|
|
267
306
|
|
|
@@ -269,6 +308,9 @@ export interface ServiceRatesAssociationExt extends ServiceRatesAssociation {
|
|
|
269
308
|
serviceGeneralRates?: ServiceRate;
|
|
270
309
|
serviceDailyRates?: ServiceDailyRates;
|
|
271
310
|
serviceSpecialRates?: ServiceSpecialRates;
|
|
311
|
+
|
|
312
|
+
addons: ServiceAddon[];
|
|
313
|
+
packages: ServicePackageExt[];
|
|
272
314
|
}
|
|
273
315
|
|
|
274
316
|
|