@bash-app/bash-common 29.19.35 → 29.20.1

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.19.35",
3
+ "version": "29.20.1",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1361,27 +1361,34 @@ model ServiceRate {
1361
1361
  rateType ServiceRateType?
1362
1362
  hourlyRate Int?
1363
1363
  dailyRate Int?
1364
- serviceSpecialRates ServiceSpecialRates?
1365
1364
  serviceDailyRates ServiceDailyRates?
1366
- serviceRatesAssociation ServiceRatesAssociation?
1365
+ serviceHourlyRates ServiceHourlyRates?
1367
1366
 
1368
1367
  @@index([rateType])
1368
+ serviceSpecialDailyRates ServiceSpecialRates[] @relation("SpecialDailyRate")
1369
+ serviceSpecialHourlyRates ServiceSpecialRates[] @relation("SpecialHourlyRate")
1369
1370
  }
1370
1371
 
1371
1372
  model ServiceSpecialRates {
1372
- id String @id @default(cuid())
1373
- startDate DateTime @db.Date
1374
- endDate DateTime @db.Date
1373
+ id String @id @default(cuid())
1374
+ startDate DateTime @db.Date
1375
+ endDate DateTime @db.Date
1375
1376
 
1376
- serviceRateId String?
1377
- serviceRate ServiceRate? @relation(fields: [serviceRateId], references: [id], onDelete: Cascade)
1378
- isAvailable Boolean
1377
+ specialHourlyRateId String?
1378
+ specialHourlyRate ServiceRate? @relation("SpecialHourlyRate", fields: [specialHourlyRateId], references: [id], onDelete: Cascade)
1379
1379
 
1380
- serviceRatesAssociation ServiceRatesAssociation?
1380
+ specialDailyRateId String?
1381
+ specialDailyRate ServiceRate? @relation("SpecialDailyRate", fields: [specialDailyRateId], references: [id], onDelete: Cascade)
1381
1382
 
1382
- @@unique([serviceRateId])
1383
+ isAvailable Boolean
1384
+
1385
+ serviceRatesAssociationId String?
1386
+
1387
+ @@unique([specialHourlyRateId])
1388
+ @@unique([specialDailyRateId])
1383
1389
  }
1384
1390
 
1391
+
1385
1392
  // different days of the week have different rates
1386
1393
  // can block of certain dates of the year and days of the week as being closed
1387
1394
  // can have special rates on different days of the year (single or range)
@@ -1400,6 +1407,21 @@ model ServiceDailyRates {
1400
1407
  @@unique([serviceRateId])
1401
1408
  }
1402
1409
 
1410
+ model ServiceHourlyRates {
1411
+ id String @id @default(cuid())
1412
+ dayOfWeek Int
1413
+ startTime DateTime @db.Time
1414
+ endTime DateTime @db.Time
1415
+ numberOfHours Int?
1416
+
1417
+ serviceRateId String?
1418
+ serviceRate ServiceRate? @relation(fields: [serviceRateId], references: [id], onDelete: Cascade)
1419
+
1420
+ serviceRatesAssociation ServiceRatesAssociation?
1421
+
1422
+ @@unique([serviceRateId])
1423
+ }
1424
+
1403
1425
  model ServiceRatesAssociation {
1404
1426
  id String @id @default(cuid())
1405
1427
 
@@ -1408,23 +1430,19 @@ model ServiceRatesAssociation {
1408
1430
  volunteerServiceId String?
1409
1431
  volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id], onDelete: Cascade)
1410
1432
 
1411
- serviceGeneralRatesId String?
1412
- serviceGeneralRates ServiceRate? @relation(fields: [serviceGeneralRatesId], references: [id], onDelete: Cascade)
1433
+ serviceHourlyRatesId String?
1434
+ serviceHourlyRates ServiceHourlyRates? @relation(fields: [serviceHourlyRatesId], references: [id], onDelete: Cascade)
1413
1435
 
1414
1436
  serviceDailyRatesId String?
1415
1437
  serviceDailyRates ServiceDailyRates? @relation(fields: [serviceDailyRatesId], references: [id], onDelete: Cascade)
1416
1438
 
1417
- serviceSpecialRatesId String?
1418
- serviceSpecialRates ServiceSpecialRates? @relation(fields: [serviceSpecialRatesId], references: [id], onDelete: Cascade)
1419
-
1420
1439
  addons ServiceAddon[]
1421
1440
  packages ServicePackage[]
1422
1441
 
1423
1442
  @@unique([serviceId])
1424
1443
  @@unique([volunteerServiceId])
1425
- @@unique([serviceGeneralRatesId])
1444
+ @@unique([serviceHourlyRatesId])
1426
1445
  @@unique([serviceDailyRatesId])
1427
- @@unique([serviceSpecialRatesId])
1428
1446
  }
1429
1447
 
1430
1448
  enum VisibilityPreference {
@@ -33,6 +33,7 @@ import {
33
33
  ServiceRatesAssociation,
34
34
  ServiceRate,
35
35
  ServiceDailyRates,
36
+ ServiceHourlyRates,
36
37
  ServiceSpecialRates,
37
38
  ServiceAddon,
38
39
  ServicePackage,
@@ -181,27 +182,27 @@ export const SERVICE_PACKAGE_DATA_TO_INCLUDE = {
181
182
  serviceAddons: true
182
183
  } satisfies Prisma.ServicePackageInclude;
183
184
 
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;
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;
205
206
 
206
207
  export interface BashNotificationExt extends BashNotification {
207
208
  creator?: PublicUser;
@@ -305,7 +306,8 @@ export interface ServiceSpecialRatesExt extends ServiceSpecialRates {
305
306
  }
306
307
 
307
308
  export interface ServiceRatesAssociationExt extends ServiceRatesAssociation {
308
- serviceGeneralRates?: ServiceRate;
309
+ // serviceGeneralRates?: ServiceRate;
310
+ serviceHourlyRates?: ServiceHourlyRates;
309
311
  serviceDailyRates?: ServiceDailyRates;
310
312
  serviceSpecialRates?: ServiceSpecialRates;
311
313