@bash-app/bash-common 29.20.1 → 29.20.2

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.20.1",
3
+ "version": "29.20.2",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1332,10 +1332,10 @@ enum ServiceRateType {
1332
1332
  //can optionally be associated with a package
1333
1333
  model ServiceAddon {
1334
1334
  id String @id @default(cuid())
1335
- name String?
1336
- description String?
1335
+ name String
1336
+ description String
1337
1337
  price Int?
1338
- quantity Int?
1338
+ quantity Int
1339
1339
 
1340
1340
  servicePackage ServicePackage? @relation(fields: [servicePackageId], references: [id], onDelete: Cascade)
1341
1341
  servicePackageId String?
@@ -1358,61 +1358,39 @@ model ServicePackage {
1358
1358
 
1359
1359
  model ServiceRate {
1360
1360
  id String @id @default(cuid())
1361
- rateType ServiceRateType?
1361
+ rateType ServiceRateType
1362
1362
  hourlyRate Int?
1363
1363
  dailyRate Int?
1364
+ serviceSpecialRates ServiceSpecialRates?
1364
1365
  serviceDailyRates ServiceDailyRates?
1365
- serviceHourlyRates ServiceHourlyRates?
1366
+ serviceRatesAssociation ServiceRatesAssociation?
1366
1367
 
1367
1368
  @@index([rateType])
1368
- serviceSpecialDailyRates ServiceSpecialRates[] @relation("SpecialDailyRate")
1369
- serviceSpecialHourlyRates ServiceSpecialRates[] @relation("SpecialHourlyRate")
1370
1369
  }
1371
1370
 
1372
1371
  model ServiceSpecialRates {
1373
- id String @id @default(cuid())
1374
- startDate DateTime @db.Date
1375
- endDate DateTime @db.Date
1376
-
1377
- specialHourlyRateId String?
1378
- specialHourlyRate ServiceRate? @relation("SpecialHourlyRate", fields: [specialHourlyRateId], references: [id], onDelete: Cascade)
1379
-
1380
- specialDailyRateId String?
1381
- specialDailyRate ServiceRate? @relation("SpecialDailyRate", fields: [specialDailyRateId], references: [id], onDelete: Cascade)
1382
-
1383
- isAvailable Boolean
1384
-
1385
- serviceRatesAssociationId String?
1386
-
1387
- @@unique([specialHourlyRateId])
1388
- @@unique([specialDailyRateId])
1389
- }
1390
-
1391
-
1392
- // different days of the week have different rates
1393
- // can block of certain dates of the year and days of the week as being closed
1394
- // can have special rates on different days of the year (single or range)
1395
- // free trial period with promo code (1 or 2 months of listing for free)
1396
- model ServiceDailyRates {
1397
1372
  id String @id @default(cuid())
1398
- dayOfWeek Int
1399
- startTime DateTime @db.Time
1400
- endTime DateTime @db.Time
1373
+ startDate DateTime @db.Date
1374
+ endDate DateTime @db.Date
1401
1375
 
1402
1376
  serviceRateId String?
1403
1377
  serviceRate ServiceRate? @relation(fields: [serviceRateId], references: [id], onDelete: Cascade)
1378
+ isAvailable Boolean
1404
1379
 
1405
1380
  serviceRatesAssociation ServiceRatesAssociation?
1406
1381
 
1407
1382
  @@unique([serviceRateId])
1408
1383
  }
1409
1384
 
1410
- model ServiceHourlyRates {
1385
+ // different days of the week have different rates
1386
+ // can block of certain dates of the year and days of the week as being closed
1387
+ // can have special rates on different days of the year (single or range)
1388
+ // free trial period with promo code (1 or 2 months of listing for free)
1389
+ model ServiceDailyRates {
1411
1390
  id String @id @default(cuid())
1412
1391
  dayOfWeek Int
1413
1392
  startTime DateTime @db.Time
1414
1393
  endTime DateTime @db.Time
1415
- numberOfHours Int?
1416
1394
 
1417
1395
  serviceRateId String?
1418
1396
  serviceRate ServiceRate? @relation(fields: [serviceRateId], references: [id], onDelete: Cascade)
@@ -1430,19 +1408,23 @@ model ServiceRatesAssociation {
1430
1408
  volunteerServiceId String?
1431
1409
  volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id], onDelete: Cascade)
1432
1410
 
1433
- serviceHourlyRatesId String?
1434
- serviceHourlyRates ServiceHourlyRates? @relation(fields: [serviceHourlyRatesId], references: [id], onDelete: Cascade)
1411
+ serviceGeneralRatesId String?
1412
+ serviceGeneralRates ServiceRate? @relation(fields: [serviceGeneralRatesId], references: [id], onDelete: Cascade)
1435
1413
 
1436
1414
  serviceDailyRatesId String?
1437
1415
  serviceDailyRates ServiceDailyRates? @relation(fields: [serviceDailyRatesId], references: [id], onDelete: Cascade)
1438
1416
 
1417
+ serviceSpecialRatesId String?
1418
+ serviceSpecialRates ServiceSpecialRates? @relation(fields: [serviceSpecialRatesId], references: [id], onDelete: Cascade)
1419
+
1439
1420
  addons ServiceAddon[]
1440
1421
  packages ServicePackage[]
1441
1422
 
1442
1423
  @@unique([serviceId])
1443
1424
  @@unique([volunteerServiceId])
1444
- @@unique([serviceHourlyRatesId])
1425
+ @@unique([serviceGeneralRatesId])
1445
1426
  @@unique([serviceDailyRatesId])
1427
+ @@unique([serviceSpecialRatesId])
1446
1428
  }
1447
1429
 
1448
1430
  enum VisibilityPreference {
@@ -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;
@@ -33,7 +33,6 @@ import {
33
33
  ServiceRatesAssociation,
34
34
  ServiceRate,
35
35
  ServiceDailyRates,
36
- ServiceHourlyRates,
37
36
  ServiceSpecialRates,
38
37
  ServiceAddon,
39
38
  ServicePackage,
@@ -182,27 +181,27 @@ export const SERVICE_PACKAGE_DATA_TO_INCLUDE = {
182
181
  serviceAddons: true
183
182
  } satisfies Prisma.ServicePackageInclude;
184
183
 
185
- // export const SERVICE_DAILYRATES_DATA_TO_INCLUDE = {
186
- // serviceDailyRate: true
187
- // } satisfies Prisma.ServiceDailyRatesInclude;
188
-
189
- // export const SERVICE_SPECIALHOURLYRATES_DATA_TO_INCLUDE = {
190
- // serviceHourlyRate: true
191
- // } satisfies Prisma.ServiceSpecialRatesInclude;
192
-
193
- // export const SERVICE_RATES_ASSOCIATION_DATA_TO_INCLUDE = {
194
- // serviceGeneralRates: true,
195
- // serviceDailyRates: {
196
- // include: SERVICE_DAILYRATES_DATA_TO_INCLUDE
197
- // },
198
- // serviceSpecialRates: {
199
- // include: SERVICE_SPECIALRATES_DATA_TO_INCLUDE
200
- // },
201
- // addons: true,
202
- // packages: {
203
- // include: SERVICE_PACKAGE_DATA_TO_INCLUDE
204
- // },
205
- // } satisfies Prisma.ServiceRatesAssociationInclude;
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;
206
205
 
207
206
  export interface BashNotificationExt extends BashNotification {
208
207
  creator?: PublicUser;
@@ -306,8 +305,7 @@ export interface ServiceSpecialRatesExt extends ServiceSpecialRates {
306
305
  }
307
306
 
308
307
  export interface ServiceRatesAssociationExt extends ServiceRatesAssociation {
309
- // serviceGeneralRates?: ServiceRate;
310
- serviceHourlyRates?: ServiceHourlyRates;
308
+ serviceGeneralRates?: ServiceRate;
311
309
  serviceDailyRates?: ServiceDailyRates;
312
310
  serviceSpecialRates?: ServiceSpecialRates;
313
311