@bash-app/bash-common 29.20.5 → 29.20.22
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 +7 -12
- package/src/definitions.ts +2 -12
- package/src/extendedSchemas.ts +3 -45
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -726,8 +726,6 @@ model Media {
|
|
|
726
726
|
serviceReferencingMe Service[]
|
|
727
727
|
volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id])
|
|
728
728
|
volunteerServiceId String?
|
|
729
|
-
|
|
730
|
-
stripeAccount StripeAccount[]
|
|
731
729
|
}
|
|
732
730
|
|
|
733
731
|
enum MediaType {
|
|
@@ -936,7 +934,7 @@ model AssociatedService {
|
|
|
936
934
|
model Service {
|
|
937
935
|
id String @id @default(cuid())
|
|
938
936
|
|
|
939
|
-
serviceType ServiceTypes
|
|
937
|
+
serviceType ServiceTypes
|
|
940
938
|
serviceStatus ServiceStatus @default(Draft)
|
|
941
939
|
serviceCondition ServiceCondition @default(Pending)
|
|
942
940
|
|
|
@@ -949,7 +947,7 @@ model Service {
|
|
|
949
947
|
creator User? @relation("CreatedService", fields: [creatorId], references: [id])
|
|
950
948
|
|
|
951
949
|
createdAt DateTime @default(now())
|
|
952
|
-
updatedAt DateTime
|
|
950
|
+
updatedAt DateTime @updatedAt
|
|
953
951
|
|
|
954
952
|
associatedBashesReferencingMe AssociatedBash[]
|
|
955
953
|
associatedServicesReferencingMe AssociatedService[]
|
|
@@ -1020,13 +1018,10 @@ model StripeAccount {
|
|
|
1020
1018
|
id String @id @default(cuid())
|
|
1021
1019
|
|
|
1022
1020
|
ownerId String
|
|
1023
|
-
owner User @relation(fields: [ownerId], references: [id]
|
|
1021
|
+
owner User @relation(fields: [ownerId], references: [id])
|
|
1024
1022
|
|
|
1025
1023
|
stripeAccountId String
|
|
1026
1024
|
|
|
1027
|
-
logoId String?
|
|
1028
|
-
logo Media? @relation(fields: [logoId], references: [id], onDelete: SetNull)
|
|
1029
|
-
|
|
1030
1025
|
createdAt DateTime @default(now())
|
|
1031
1026
|
updatedAt DateTime @updatedAt
|
|
1032
1027
|
|
|
@@ -1387,10 +1382,10 @@ model ServiceSpecialRates {
|
|
|
1387
1382
|
// can have special rates on different days of the year (single or range)
|
|
1388
1383
|
// free trial period with promo code (1 or 2 months of listing for free)
|
|
1389
1384
|
model ServiceDailyRates {
|
|
1390
|
-
id
|
|
1391
|
-
dayOfWeek
|
|
1392
|
-
|
|
1393
|
-
|
|
1385
|
+
id String @id @default(cuid())
|
|
1386
|
+
dayOfWeek Int
|
|
1387
|
+
startDateTime DateTime @db.Time
|
|
1388
|
+
endDateTime DateTime @db.Time
|
|
1394
1389
|
|
|
1395
1390
|
serviceRateId String?
|
|
1396
1391
|
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 = 10 as const;
|
|
83
83
|
|
|
84
84
|
export const DEBOUNCE_WAIT = 1000 as const;
|
|
85
85
|
|
|
@@ -229,16 +229,6 @@ 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
|
-
|
|
242
232
|
export interface ApiResult<T, P extends ErrorDataType = ErrorDataType> {
|
|
243
233
|
data?: T;
|
|
244
234
|
status?: number;
|
|
@@ -317,7 +307,7 @@ export type StripeLinkingStatus = {
|
|
|
317
307
|
};
|
|
318
308
|
|
|
319
309
|
export type StripeBusinessDataPublic = {
|
|
320
|
-
|
|
310
|
+
logo?: string; //not possible to fetch logo directly from stripe
|
|
321
311
|
businessName?: string;
|
|
322
312
|
businessNameDBA?: string;
|
|
323
313
|
supportEmail?: string;
|
package/src/extendedSchemas.ts
CHANGED
|
@@ -35,7 +35,6 @@ import {
|
|
|
35
35
|
ServiceDailyRates,
|
|
36
36
|
ServiceSpecialRates,
|
|
37
37
|
ServiceAddon,
|
|
38
|
-
ServicePackage,
|
|
39
38
|
} from "@prisma/client";
|
|
40
39
|
import { SERVICE_LINK_DATA_TO_INCLUDE, UnionFromArray } from "./definitions";
|
|
41
40
|
|
|
@@ -177,32 +176,6 @@ export const SERVICE_FULL_DATA_TO_INCLUDE = {
|
|
|
177
176
|
...createAllTrueObject(serviceKeysArray)
|
|
178
177
|
} satisfies Prisma.ServiceInclude;
|
|
179
178
|
|
|
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
|
-
|
|
206
179
|
export interface BashNotificationExt extends BashNotification {
|
|
207
180
|
creator?: PublicUser;
|
|
208
181
|
bashEvent?: BashEvent;
|
|
@@ -257,16 +230,6 @@ export const EVENT_TASK_DATA_TO_INCLUDE = {
|
|
|
257
230
|
}
|
|
258
231
|
} satisfies Prisma.EventTaskInclude;
|
|
259
232
|
|
|
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
|
-
|
|
270
233
|
//---------------Services------------------
|
|
271
234
|
export interface ServiceExt extends Service {
|
|
272
235
|
owner?: PublicUser | null;
|
|
@@ -289,18 +252,16 @@ export interface ServiceExt extends Service {
|
|
|
289
252
|
venue?: Venue;
|
|
290
253
|
organization?: Organization;
|
|
291
254
|
|
|
292
|
-
serviceRatesAssociation?: ServiceRatesAssociationExt | null;
|
|
293
|
-
|
|
294
255
|
// googleReviews: GoogleReview[];
|
|
295
256
|
}
|
|
296
|
-
export interface ServicePackageExt extends
|
|
297
|
-
serviceAddons: ServiceAddon[]
|
|
257
|
+
export interface ServicePackageExt extends ServiceDailyRates {
|
|
258
|
+
serviceAddons: ServiceAddon[]
|
|
298
259
|
}
|
|
299
260
|
|
|
300
261
|
export interface ServiceDailyRatesExt extends ServiceDailyRates {
|
|
301
262
|
serviceRate?: ServiceRate;
|
|
302
263
|
}
|
|
303
|
-
export interface ServiceSpecialRatesExt extends
|
|
264
|
+
export interface ServiceSpecialRatesExt extends ServiceRatesAssociation {
|
|
304
265
|
serviceRate?: ServiceRate;
|
|
305
266
|
}
|
|
306
267
|
|
|
@@ -308,9 +269,6 @@ export interface ServiceRatesAssociationExt extends ServiceRatesAssociation {
|
|
|
308
269
|
serviceGeneralRates?: ServiceRate;
|
|
309
270
|
serviceDailyRates?: ServiceDailyRates;
|
|
310
271
|
serviceSpecialRates?: ServiceSpecialRates;
|
|
311
|
-
|
|
312
|
-
addons: ServiceAddon[];
|
|
313
|
-
packages: ServicePackageExt[];
|
|
314
272
|
}
|
|
315
273
|
|
|
316
274
|
|