@bash-app/bash-common 29.7.0 → 29.9.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 +1 -1
- package/prisma/schema.prisma +28 -1
- package/src/definitions.ts +24 -0
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -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
|
-
|
|
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 {
|
package/src/definitions.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
Contact,
|
|
6
6
|
DayOfWeek,
|
|
7
7
|
Prisma,
|
|
8
|
+
Rate,
|
|
8
9
|
Ticket,
|
|
9
10
|
TicketTier,
|
|
10
11
|
User,
|
|
@@ -83,6 +84,9 @@ export const DEBOUNCE_WAIT = 1000 as const;
|
|
|
83
84
|
export const ASSET_KEY_DELIM = '__' as const;
|
|
84
85
|
export const ASSET_MAX_MD5_BYTE_LENGTH = 1024 * 100; // 100kb
|
|
85
86
|
|
|
87
|
+
export const MIN_NUMBER_OF_HOURS = 1;
|
|
88
|
+
export const DEFAULT_MAX_NUMBER_OF_HOURS = 24;
|
|
89
|
+
|
|
86
90
|
export const SERVICE_LINK_DATA_TO_INCLUDE = {
|
|
87
91
|
link: true,
|
|
88
92
|
} satisfies Prisma.ServiceLinkInclude;
|
|
@@ -190,6 +194,26 @@ export interface AvailableTicketsForTicketTier {
|
|
|
190
194
|
availableTickets: NumberOfTicketsForDate[];
|
|
191
195
|
}
|
|
192
196
|
|
|
197
|
+
export interface NumberOfHoursForDate {
|
|
198
|
+
numberOfHours: number;
|
|
199
|
+
bookingDateTime: DateTimeArgType;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// export interface AvailableNumberOfHoursForRate {
|
|
203
|
+
// rate: Rate;
|
|
204
|
+
// availableHours: NumberOfHoursForDate[];
|
|
205
|
+
// }
|
|
206
|
+
|
|
207
|
+
export interface AvailableHoursForRateForDate {
|
|
208
|
+
rate: Rate,
|
|
209
|
+
availableHoursForDate: NumberOfHoursForDate;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// export interface AvailableHoursForRate {
|
|
213
|
+
// rate: Rate;
|
|
214
|
+
// availableHours: NumberOfHoursForDate[];
|
|
215
|
+
// }
|
|
216
|
+
|
|
193
217
|
export interface SignInEmailWithPassword {
|
|
194
218
|
email: string;
|
|
195
219
|
password: string;
|