@bash-app/bash-common 30.15.0 → 30.17.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 +55 -33
- package/src/definitions.ts +1 -0
- package/src/extendedSchemas.ts +1 -1
- package/src/utils/stripeAccountUtils.ts +4 -3
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -240,6 +240,7 @@ model Invitation {
|
|
|
240
240
|
acceptedDate DateTime?
|
|
241
241
|
rejectedDate DateTime?
|
|
242
242
|
maybeDate DateTime?
|
|
243
|
+
isFreeGuest Boolean @default(false)
|
|
243
244
|
tickets Ticket[] @relation("TicketsForInvitation")
|
|
244
245
|
bashNotifications BashNotification[]
|
|
245
246
|
associatedBash AssociatedBash?
|
|
@@ -312,6 +313,7 @@ model BashEvent {
|
|
|
312
313
|
venue Venue? @relation(fields: [venueId], references: [id])
|
|
313
314
|
userPromoCodeRedemption UserPromoCodeRedemption[]
|
|
314
315
|
averageRating Float? @default(0)
|
|
316
|
+
serviceBookings ServiceBooking[] // Add this field to create the reverse relation
|
|
315
317
|
}
|
|
316
318
|
|
|
317
319
|
model Coordinates {
|
|
@@ -928,12 +930,12 @@ enum SocialMediaPlatform {
|
|
|
928
930
|
}
|
|
929
931
|
|
|
930
932
|
model User {
|
|
931
|
-
id String
|
|
932
|
-
email String
|
|
933
|
-
createdOn DateTime
|
|
934
|
-
stripeCustomerId String?
|
|
935
|
-
stripeAccountId String?
|
|
936
|
-
isSuperUser Boolean
|
|
933
|
+
id String @id @default(cuid())
|
|
934
|
+
email String @unique
|
|
935
|
+
createdOn DateTime @default(now())
|
|
936
|
+
stripeCustomerId String? @unique
|
|
937
|
+
stripeAccountId String? @unique
|
|
938
|
+
isSuperUser Boolean @default(false)
|
|
937
939
|
// isSuspended Boolean @default(false)
|
|
938
940
|
intent UserIntent?
|
|
939
941
|
googleCalendarAccess String?
|
|
@@ -946,12 +948,12 @@ model User {
|
|
|
946
948
|
dob DateTime?
|
|
947
949
|
gender Gender?
|
|
948
950
|
sex Sex?
|
|
949
|
-
roles UserRole[]
|
|
950
|
-
ownedServices Service[]
|
|
951
|
-
createdServices Service[]
|
|
952
|
-
createdEvents BashEvent[]
|
|
953
|
-
ticketsISent Ticket[]
|
|
954
|
-
ticketsIOwn Ticket[]
|
|
951
|
+
roles UserRole[] @default([User])
|
|
952
|
+
ownedServices Service[] @relation("OwnedService")
|
|
953
|
+
createdServices Service[] @relation("CreatedService")
|
|
954
|
+
createdEvents BashEvent[] @relation("CreatedEvent")
|
|
955
|
+
ticketsISent Ticket[] @relation("TicketsISent")
|
|
956
|
+
ticketsIOwn Ticket[] @relation("TicketsIOwn")
|
|
955
957
|
reviews Review[]
|
|
956
958
|
sponsorships SponsoredEvent[]
|
|
957
959
|
investments Investment[]
|
|
@@ -974,34 +976,37 @@ model User {
|
|
|
974
976
|
city String?
|
|
975
977
|
state String?
|
|
976
978
|
zipCode String?
|
|
977
|
-
country String?
|
|
979
|
+
country String? @default("US")
|
|
978
980
|
phone String?
|
|
979
981
|
socialMediaProfiles SocialMediaProfile[]
|
|
980
|
-
documentIDId String?
|
|
982
|
+
documentIDId String? @unique
|
|
981
983
|
documentID DocumentID?
|
|
982
984
|
comment BashComment[]
|
|
983
985
|
associatedBashes AssociatedBash[]
|
|
984
986
|
associatedServices AssociatedService[]
|
|
985
|
-
invitationsCreatedByMe Invitation[]
|
|
986
|
-
invitationsSentToMe Invitation[]
|
|
987
|
-
notificationsCreatedByMe BashNotification[]
|
|
988
|
-
remindersCreatedByMe Reminder[]
|
|
989
|
-
remindersAssignedToMe Reminder[]
|
|
990
|
-
eventTasksAssignedToMe EventTask[]
|
|
987
|
+
invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
|
|
988
|
+
invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
|
|
989
|
+
notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
|
|
990
|
+
remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
|
|
991
|
+
remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
|
|
992
|
+
eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
|
|
991
993
|
checkouts Checkout[]
|
|
992
994
|
ticketTiersWaitListsIveJoined TicketTier[]
|
|
993
995
|
contacts Contact[]
|
|
994
|
-
|
|
996
|
+
contactLists ContactList[] @relation("UserContactLists")
|
|
997
|
+
contactlist ContactList[]
|
|
998
|
+
|
|
999
|
+
bashEventPromoCodesIUsed BashEventPromoCode[]
|
|
995
1000
|
// bookingForMe Booking[]
|
|
996
|
-
userSubscription
|
|
1001
|
+
userSubscription UserSubscription?
|
|
997
1002
|
// serviceSubscriptions ServiceSubscription[]
|
|
998
|
-
volunteerService
|
|
999
|
-
stripeAccounts
|
|
1000
|
-
userPromoCodeRedemption
|
|
1001
|
-
accepted
|
|
1002
|
-
boughtTicket
|
|
1003
|
-
noPay
|
|
1004
|
-
supportedEvent
|
|
1003
|
+
volunteerService VolunteerService[]
|
|
1004
|
+
stripeAccounts StripeAccount[]
|
|
1005
|
+
userPromoCodeRedemption UserPromoCodeRedemption[]
|
|
1006
|
+
accepted Boolean? @default(false) // Tracks if the user accepted the invitation
|
|
1007
|
+
boughtTicket Boolean? @default(false) // Tracks if the user bought a ticket
|
|
1008
|
+
noPay Boolean? @default(false) // Tracks if the user is marked as "noPay"
|
|
1009
|
+
supportedEvent Boolean? @default(false) // Tracks if the user supported the event
|
|
1005
1010
|
|
|
1006
1011
|
// primaryStripeAccountDBId String? @unique
|
|
1007
1012
|
// primaryStripeAccountDB StripeAccount? @relation("PrimaryStripeAccount", fields: [primaryStripeAccountDBId], references: [id], onDelete: Restrict, onUpdate: Restrict)
|
|
@@ -1011,10 +1016,10 @@ model User {
|
|
|
1011
1016
|
promoter Promoter[]
|
|
1012
1017
|
promoterStats PromoterStats?
|
|
1013
1018
|
|
|
1014
|
-
|
|
1015
|
-
blocksReceived
|
|
1016
|
-
unblocksCreated
|
|
1017
|
-
unblocksReceived
|
|
1019
|
+
blocksCreated BlockedUser[] @relation("UserBlocksMade")
|
|
1020
|
+
blocksReceived BlockedUser[] @relation("UserBlocksReceived")
|
|
1021
|
+
unblocksCreated UnblockedUserHistory[] @relation("UserUnblocksMade")
|
|
1022
|
+
unblocksReceived UnblockedUserHistory[] @relation("UserUnblocksReceived")
|
|
1018
1023
|
}
|
|
1019
1024
|
|
|
1020
1025
|
model Contact {
|
|
@@ -1031,6 +1036,20 @@ model Contact {
|
|
|
1031
1036
|
@@index([contactEmail])
|
|
1032
1037
|
}
|
|
1033
1038
|
|
|
1039
|
+
model ContactList {
|
|
1040
|
+
id String @id @default(cuid())
|
|
1041
|
+
name String
|
|
1042
|
+
ownerId String
|
|
1043
|
+
owner User @relation("UserContactLists", fields: [ownerId], references: [id], onDelete: Cascade)
|
|
1044
|
+
contactIds String[] // Array of contact IDs
|
|
1045
|
+
createdAt DateTime @default(now())
|
|
1046
|
+
updatedAt DateTime @updatedAt
|
|
1047
|
+
User User? @relation(fields: [userId], references: [id])
|
|
1048
|
+
userId String?
|
|
1049
|
+
|
|
1050
|
+
@@index([ownerId])
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1034
1053
|
model BlockedUser {
|
|
1035
1054
|
id String @id @default(cuid())
|
|
1036
1055
|
blockerId String // User who blocked
|
|
@@ -1909,6 +1928,9 @@ model ServiceBooking {
|
|
|
1909
1928
|
daysTotalATBCents Int //ATB=At Time of Booking
|
|
1910
1929
|
totalATBCents Int
|
|
1911
1930
|
|
|
1931
|
+
bashEventId String?
|
|
1932
|
+
bashEvent BashEvent? @relation(fields: [bashEventId], references: [id])
|
|
1933
|
+
|
|
1912
1934
|
@@index([status])
|
|
1913
1935
|
@@index([creatorId])
|
|
1914
1936
|
@@index([forUserId])
|
package/src/definitions.ts
CHANGED
|
@@ -256,6 +256,7 @@ export type ApiServiceBookingParams = {
|
|
|
256
256
|
bookedDays: ApiServiceBookedDayParams[];
|
|
257
257
|
timezone: string;
|
|
258
258
|
attendeeOption: ServiceAttendeeOption;
|
|
259
|
+
bashEventId?: string;
|
|
259
260
|
};
|
|
260
261
|
|
|
261
262
|
export type ApiServiceCanBookParams = {} & ApiServiceBookingParams;
|
package/src/extendedSchemas.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { StripeLinkingStatus } from "../definitions";
|
|
2
|
-
import { isProduction } from "./apiUtils";
|
|
3
2
|
|
|
4
3
|
export const stripeAccountFullyLinked = (
|
|
5
|
-
linkingStatus: StripeLinkingStatus
|
|
4
|
+
linkingStatus: StripeLinkingStatus | null | undefined
|
|
6
5
|
): boolean => {
|
|
7
6
|
return (
|
|
7
|
+
linkingStatus != null &&
|
|
8
8
|
!linkingStatus.hasOutstandingRequirements &&
|
|
9
9
|
linkingStatus.isOnboarded &&
|
|
10
10
|
linkingStatus.paymentsEnabled &&
|
|
11
|
-
|
|
11
|
+
linkingStatus.taxMonitoringEnabled
|
|
12
|
+
// (!isProduction() || linkingStatus.taxMonitoringEnabled);
|
|
12
13
|
);
|
|
13
14
|
};
|