@bash-app/bash-common 30.130.0 → 30.132.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 +67 -0
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -712,6 +712,10 @@ model BashEvent {
|
|
|
712
712
|
// Analytics Relations
|
|
713
713
|
analyticsPredictions AnalyticsPrediction[]
|
|
714
714
|
|
|
715
|
+
// Event series (recurring template instances)
|
|
716
|
+
eventSeriesId String?
|
|
717
|
+
eventSeries EventSeries? @relation("SeriesEvents", fields: [eventSeriesId], references: [id], onDelete: SetNull)
|
|
718
|
+
|
|
715
719
|
// Organization Relations
|
|
716
720
|
budgets Budget[] @relation("EventBudgets")
|
|
717
721
|
rsvps EventRSVP[] @relation("EventRSVPs")
|
|
@@ -719,6 +723,7 @@ model BashEvent {
|
|
|
719
723
|
@@index([templateId])
|
|
720
724
|
@@index([parentEventId])
|
|
721
725
|
@@index([organizationId])
|
|
726
|
+
@@index([eventSeriesId])
|
|
722
727
|
}
|
|
723
728
|
|
|
724
729
|
// ============================================
|
|
@@ -861,6 +866,26 @@ model BashCreditTransaction {
|
|
|
861
866
|
@@index([type])
|
|
862
867
|
}
|
|
863
868
|
|
|
869
|
+
model PendingBashPointsGift {
|
|
870
|
+
id String @id @default(cuid())
|
|
871
|
+
senderId String
|
|
872
|
+
sender User @relation("SentPendingGifts", fields: [senderId], references: [id], onDelete: Cascade)
|
|
873
|
+
recipientEmail String
|
|
874
|
+
amount Int
|
|
875
|
+
message String?
|
|
876
|
+
status PendingGiftStatus @default(Pending)
|
|
877
|
+
claimedAt DateTime?
|
|
878
|
+
claimedByUserId String?
|
|
879
|
+
claimedBy User? @relation("ClaimedPendingGifts", fields: [claimedByUserId], references: [id], onDelete: SetNull)
|
|
880
|
+
returnedAt DateTime?
|
|
881
|
+
expiresAt DateTime
|
|
882
|
+
createdAt DateTime @default(now())
|
|
883
|
+
|
|
884
|
+
@@index([recipientEmail, status])
|
|
885
|
+
@@index([senderId])
|
|
886
|
+
@@index([expiresAt, status])
|
|
887
|
+
}
|
|
888
|
+
|
|
864
889
|
model UserReferralCode {
|
|
865
890
|
id String @id @default(cuid())
|
|
866
891
|
userId String @unique
|
|
@@ -1067,6 +1092,31 @@ model Recurrence {
|
|
|
1067
1092
|
bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
|
|
1068
1093
|
}
|
|
1069
1094
|
|
|
1095
|
+
// Recurring event series: template that spawns many BashEvent instances (e.g. "Every Tuesday 7pm for 14 weeks")
|
|
1096
|
+
model EventSeries {
|
|
1097
|
+
id String @id @default(cuid())
|
|
1098
|
+
organizationId String?
|
|
1099
|
+
creatorId String
|
|
1100
|
+
name String
|
|
1101
|
+
description String? @db.Text
|
|
1102
|
+
frequency RecurringFrequency
|
|
1103
|
+
interval Int @default(1)
|
|
1104
|
+
repeatOnDays DayOfWeek[]
|
|
1105
|
+
seriesStart DateTime
|
|
1106
|
+
seriesEnd DateTime
|
|
1107
|
+
exceptions Json? // Array of ISO date strings to skip
|
|
1108
|
+
templateConfig Json? // Event defaults: title pattern, ticketTiers, etc.
|
|
1109
|
+
createdAt DateTime @default(now())
|
|
1110
|
+
updatedAt DateTime @updatedAt
|
|
1111
|
+
|
|
1112
|
+
organization Organization? @relation("OrganizationEventSeries", fields: [organizationId], references: [id], onDelete: SetNull)
|
|
1113
|
+
creator User @relation("EventSeriesCreator", fields: [creatorId], references: [id], onDelete: Restrict)
|
|
1114
|
+
events BashEvent[] @relation("SeriesEvents")
|
|
1115
|
+
|
|
1116
|
+
@@index([organizationId])
|
|
1117
|
+
@@index([creatorId])
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1070
1120
|
model CustomBashEventType {
|
|
1071
1121
|
id String @id @default(cuid())
|
|
1072
1122
|
key String @unique
|
|
@@ -1431,6 +1481,8 @@ model User {
|
|
|
1431
1481
|
bashEventMessagesRead BashEventMessageRead[] @relation("BashMessageReader")
|
|
1432
1482
|
transferRequestsFrom BashEventTransferRequest[] @relation("TransferRequestsFrom")
|
|
1433
1483
|
transferRequestsTo BashEventTransferRequest[] @relation("TransferRequestsTo")
|
|
1484
|
+
sentPendingGifts PendingBashPointsGift[] @relation("SentPendingGifts")
|
|
1485
|
+
claimedPendingGifts PendingBashPointsGift[] @relation("ClaimedPendingGifts")
|
|
1434
1486
|
biometricCredentials BiometricCredential[]
|
|
1435
1487
|
blocksReceived BlockedUser[] @relation("UserBlocksReceived")
|
|
1436
1488
|
blocksCreated BlockedUser[] @relation("UserBlocksMade")
|
|
@@ -1571,6 +1623,7 @@ model User {
|
|
|
1571
1623
|
ownedBudgets Budget[] @relation("UserBudgets")
|
|
1572
1624
|
departmentsHeaded Department[] @relation("DepartmentHead")
|
|
1573
1625
|
favoriteOrganizations Organization[] @relation("FavoriteOrganizations")
|
|
1626
|
+
eventSeriesCreated EventSeries[] @relation("EventSeriesCreator")
|
|
1574
1627
|
|
|
1575
1628
|
// Service Includes & Add-On Requests
|
|
1576
1629
|
suggestedIncludes ServiceInclude[] @relation("SuggestedIncludes")
|
|
@@ -2440,6 +2493,8 @@ model Organization {
|
|
|
2440
2493
|
subscriptionStatus String?
|
|
2441
2494
|
stripeSubscriptionId String? @unique
|
|
2442
2495
|
stripeCustomerId String?
|
|
2496
|
+
stripeConnectedAccountId String? // Org-level Stripe account for wallet display
|
|
2497
|
+
inheritBrandingFromParent Boolean @default(true)
|
|
2443
2498
|
createdAt DateTime @default(now())
|
|
2444
2499
|
updatedAt DateTime @updatedAt
|
|
2445
2500
|
service Service?
|
|
@@ -2450,6 +2505,7 @@ model Organization {
|
|
|
2450
2505
|
budgets Budget[] @relation("OrganizationBudgets")
|
|
2451
2506
|
departments Department[]
|
|
2452
2507
|
bashEvents BashEvent[] @relation("OrganizationBashEvents")
|
|
2508
|
+
eventSeries EventSeries[] @relation("OrganizationEventSeries")
|
|
2453
2509
|
favoriteBy User[] @relation("FavoriteOrganizations")
|
|
2454
2510
|
|
|
2455
2511
|
@@index([ownerId])
|
|
@@ -2473,6 +2529,10 @@ model OrganizationMember {
|
|
|
2473
2529
|
canInvite Boolean @default(true)
|
|
2474
2530
|
canCreateEvents Boolean @default(false)
|
|
2475
2531
|
canManageBudgets Boolean @default(false)
|
|
2532
|
+
engagementScore Float? // Computed: weighted formula (events, recency, points, referrals)
|
|
2533
|
+
lastActiveAt DateTime? // Last event attended
|
|
2534
|
+
totalEventsAttended Int @default(0)
|
|
2535
|
+
firstEventAttendedAt DateTime?
|
|
2476
2536
|
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
2477
2537
|
user User @relation("OrganizationMemberUser", fields: [userId], references: [id], onDelete: Cascade)
|
|
2478
2538
|
eventRSVPs EventRSVP[]
|
|
@@ -5402,6 +5462,13 @@ enum CreditSourceType {
|
|
|
5402
5462
|
AdminAdjustment // Manual credit by admin
|
|
5403
5463
|
PromotionalBonus // Marketing campaigns
|
|
5404
5464
|
PromoterCommission // Commission earned from promo code usage
|
|
5465
|
+
GiftedPoints // BashPoints gifted to another user
|
|
5466
|
+
}
|
|
5467
|
+
|
|
5468
|
+
enum PendingGiftStatus {
|
|
5469
|
+
Pending
|
|
5470
|
+
Claimed
|
|
5471
|
+
Returned
|
|
5405
5472
|
}
|
|
5406
5473
|
|
|
5407
5474
|
enum ReferralTier {
|