@bash-app/bash-common 29.21.26 → 29.22.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.21.26",
3
+ "version": "29.22.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",
@@ -948,7 +948,7 @@ model Service {
948
948
  creatorId String?
949
949
  creator User? @relation("CreatedService", fields: [creatorId], references: [id])
950
950
 
951
- createdAt DateTime @default(now())
951
+ createdAt DateTime @default(now())
952
952
  updatedAt DateTime? @updatedAt
953
953
 
954
954
  associatedBashesReferencingMe AssociatedBash[]
@@ -1024,8 +1024,8 @@ model StripeAccount {
1024
1024
 
1025
1025
  stripeAccountId String
1026
1026
 
1027
- logoId String?
1028
- logo Media? @relation(fields: [logoId], references: [id], onDelete: SetNull)
1027
+ logoId String?
1028
+ logo Media? @relation(fields: [logoId], references: [id], onDelete: SetNull)
1029
1029
 
1030
1030
  createdAt DateTime @default(now())
1031
1031
  updatedAt DateTime @updatedAt
@@ -1368,6 +1368,7 @@ model ServiceRate {
1368
1368
  @@index([rateType])
1369
1369
  }
1370
1370
 
1371
+ // if isAvailable is false it is closed
1371
1372
  model ServiceSpecialRates {
1372
1373
  id String @id @default(cuid())
1373
1374
  startDate DateTime @db.Date
@@ -1377,7 +1378,8 @@ model ServiceSpecialRates {
1377
1378
  serviceRate ServiceRate? @relation(fields: [serviceRateId], references: [id], onDelete: Cascade)
1378
1379
  isAvailable Boolean
1379
1380
 
1380
- serviceRatesAssociation ServiceRatesAssociation?
1381
+ serviceRatesAssociationId String
1382
+ serviceRatesAssociation ServiceRatesAssociation @relation(fields: [serviceRatesAssociationId], references: [id], onDelete: Cascade)
1381
1383
 
1382
1384
  @@unique([serviceRateId])
1383
1385
  }
@@ -1387,15 +1389,16 @@ model ServiceSpecialRates {
1387
1389
  // can have special rates on different days of the year (single or range)
1388
1390
  // free trial period with promo code (1 or 2 months of listing for free)
1389
1391
  model ServiceDailyRates {
1390
- id String @id @default(cuid())
1391
- dayOfWeek Int
1392
- startTime DateTime @db.Time
1393
- endTime DateTime @db.Time
1392
+ id String @id @default(cuid())
1393
+ dayOfWeek DayOfWeek
1394
+ startTime DateTime @db.Time
1395
+ endTime DateTime @db.Time
1394
1396
 
1395
1397
  serviceRateId String?
1396
1398
  serviceRate ServiceRate? @relation(fields: [serviceRateId], references: [id], onDelete: Cascade)
1397
1399
 
1398
- serviceRatesAssociation ServiceRatesAssociation?
1400
+ serviceRatesAssociationId String
1401
+ serviceRatesAssociation ServiceRatesAssociation @relation(fields: [serviceRatesAssociationId], references: [id], onDelete: Cascade)
1399
1402
 
1400
1403
  @@unique([serviceRateId])
1401
1404
  }
@@ -1411,11 +1414,8 @@ model ServiceRatesAssociation {
1411
1414
  serviceGeneralRatesId String?
1412
1415
  serviceGeneralRates ServiceRate? @relation(fields: [serviceGeneralRatesId], references: [id], onDelete: Cascade)
1413
1416
 
1414
- serviceDailyRatesId String?
1415
- serviceDailyRates ServiceDailyRates? @relation(fields: [serviceDailyRatesId], references: [id], onDelete: Cascade)
1416
-
1417
- serviceSpecialRatesId String?
1418
- serviceSpecialRates ServiceSpecialRates? @relation(fields: [serviceSpecialRatesId], references: [id], onDelete: Cascade)
1417
+ serviceDailyRates ServiceDailyRates[]
1418
+ serviceSpecialRates ServiceSpecialRates[]
1419
1419
 
1420
1420
  addons ServiceAddon[]
1421
1421
  packages ServicePackage[]
@@ -1423,8 +1423,6 @@ model ServiceRatesAssociation {
1423
1423
  @@unique([serviceId])
1424
1424
  @@unique([volunteerServiceId])
1425
1425
  @@unique([serviceGeneralRatesId])
1426
- @@unique([serviceDailyRatesId])
1427
- @@unique([serviceSpecialRatesId])
1428
1426
  }
1429
1427
 
1430
1428
  enum VisibilityPreference {
@@ -305,12 +305,12 @@ export interface ServiceSpecialRatesExt extends ServiceSpecialRates {
305
305
  }
306
306
 
307
307
  export interface ServiceRatesAssociationExt extends ServiceRatesAssociation {
308
- serviceGeneralRates?: ServiceRate;
309
- serviceDailyRates?: ServiceDailyRates;
310
- serviceSpecialRates?: ServiceSpecialRates;
308
+ serviceGeneralRates?: ServiceRate | null;
309
+ serviceDailyRates?: ServiceDailyRates[];
310
+ serviceSpecialRates?: ServiceSpecialRates[];
311
311
 
312
- addons: ServiceAddon[];
313
- packages: ServicePackageExt[];
312
+ addons?: ServiceAddon[];
313
+ packages?: ServicePackageExt[];
314
314
  }
315
315
 
316
316