@bash-app/bash-common 29.7.0 → 29.8.0

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.7.0",
3
+ "version": "29.8.0",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -137,6 +137,7 @@ model BashEventPromoCode {
137
137
  usedBy User[]
138
138
 
139
139
  @@unique([ticketTierId, code])
140
+
140
141
  }
141
142
 
142
143
  model BashNotification {
@@ -237,6 +238,7 @@ model BashEvent {
237
238
  isTrending Boolean?
238
239
  coordinates Coordinates[] // A BashEvent can have multiple sets of coordinates
239
240
  // stripeAccount StripeAccount[]
241
+ rate Rate[]
240
242
  }
241
243
 
242
244
  model Coordinates {
@@ -352,6 +354,28 @@ enum BookingStatus {
352
354
  Missed
353
355
  }
354
356
 
357
+ model Rate {
358
+ id String @id @default(cuid())
359
+ serviceId String @unique
360
+ service Service? @relation("SingleRate", fields: [serviceId], references: [id], onDelete: Cascade)
361
+ serviceMultipleRatesId String?
362
+ serviceMultipleRates Service? @relation("MultipleRates", fields: [serviceMultipleRatesId], references: [id], onDelete: Cascade)
363
+ bashEventId String?
364
+ bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
365
+ waitList User[]
366
+ price Int @default(0)
367
+ title String @default("Free")
368
+ sortOrder Int?
369
+ description String?
370
+ maximumNumberOfHours Int @default(24)
371
+ maximumHourCount Int @default(24)
372
+ isDonationTier Boolean?
373
+ hidden Boolean?
374
+ // promoCodes BashEventPromoCode[]
375
+
376
+ @@unique([serviceId, bashEventId, title])
377
+ }
378
+
355
379
  model Booking {
356
380
  id String @id @default(cuid())
357
381
  serviceId String
@@ -860,6 +884,7 @@ model User {
860
884
  userSubscription UserSubscription?
861
885
  serviceSubcriptions ServiceSubscription[]
862
886
  volunteerService VolunteerService[]
887
+ rate Rate[]
863
888
  }
864
889
 
865
890
  model Contact {
@@ -931,7 +956,8 @@ model Service {
931
956
  communityInvolvement String?
932
957
  emergencyContact String?
933
958
  contactDetails String?
934
- rates String?
959
+ rate Rate? @relation("SingleRate")
960
+ rates Rate[] @relation("MultipleRates")
935
961
  cancellationPolicy String?
936
962
  refundPolicy String?
937
963
  insurancePolicy String?
@@ -957,6 +983,7 @@ model Service {
957
983
  sponsor Sponsor?
958
984
  venue Venue?
959
985
  organization Organization?
986
+
960
987
  }
961
988
 
962
989
  model StripeAccount {
@@ -83,6 +83,9 @@ export const DEBOUNCE_WAIT = 1000 as const;
83
83
  export const ASSET_KEY_DELIM = '__' as const;
84
84
  export const ASSET_MAX_MD5_BYTE_LENGTH = 1024 * 100; // 100kb
85
85
 
86
+ export const MIN_NUMBER_OF_HOURS = 1;
87
+ export const DEFAULT_MAX_NUMBER_OF_HOURS = 24;
88
+
86
89
  export const SERVICE_LINK_DATA_TO_INCLUDE = {
87
90
  link: true,
88
91
  } satisfies Prisma.ServiceLinkInclude;
@@ -190,6 +193,26 @@ export interface AvailableTicketsForTicketTier {
190
193
  availableTickets: NumberOfTicketsForDate[];
191
194
  }
192
195
 
196
+ export interface NumberOfHoursForDate {
197
+ numberOfHours: number;
198
+ bookingDateTime: DateTimeArgType;
199
+ }
200
+
201
+ // export interface AvailableNumberOfHoursForRate {
202
+ // rate: Rate;
203
+ // availableHours: NumberOfHoursForDate[];
204
+ // }
205
+
206
+ // export interface AvailableHoursForRateForDate {
207
+ // rate: Rate,
208
+ // availableHoursForDate: NumberOfHoursForDate;
209
+ // }
210
+
211
+ // export interface AvailableHoursForRate {
212
+ // rate: Rate;
213
+ // availableHours: NumberOfHoursForDate[];
214
+ // }
215
+
193
216
  export interface SignInEmailWithPassword {
194
217
  email: string;
195
218
  password: string;