@bash-app/bash-common 30.131.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash-app/bash-common",
3
- "version": "30.131.0",
3
+ "version": "30.132.0",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -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
  // ============================================
@@ -1087,6 +1092,31 @@ model Recurrence {
1087
1092
  bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
1088
1093
  }
1089
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
+
1090
1120
  model CustomBashEventType {
1091
1121
  id String @id @default(cuid())
1092
1122
  key String @unique
@@ -1593,6 +1623,7 @@ model User {
1593
1623
  ownedBudgets Budget[] @relation("UserBudgets")
1594
1624
  departmentsHeaded Department[] @relation("DepartmentHead")
1595
1625
  favoriteOrganizations Organization[] @relation("FavoriteOrganizations")
1626
+ eventSeriesCreated EventSeries[] @relation("EventSeriesCreator")
1596
1627
 
1597
1628
  // Service Includes & Add-On Requests
1598
1629
  suggestedIncludes ServiceInclude[] @relation("SuggestedIncludes")
@@ -2462,6 +2493,8 @@ model Organization {
2462
2493
  subscriptionStatus String?
2463
2494
  stripeSubscriptionId String? @unique
2464
2495
  stripeCustomerId String?
2496
+ stripeConnectedAccountId String? // Org-level Stripe account for wallet display
2497
+ inheritBrandingFromParent Boolean @default(true)
2465
2498
  createdAt DateTime @default(now())
2466
2499
  updatedAt DateTime @updatedAt
2467
2500
  service Service?
@@ -2472,6 +2505,7 @@ model Organization {
2472
2505
  budgets Budget[] @relation("OrganizationBudgets")
2473
2506
  departments Department[]
2474
2507
  bashEvents BashEvent[] @relation("OrganizationBashEvents")
2508
+ eventSeries EventSeries[] @relation("OrganizationEventSeries")
2475
2509
  favoriteBy User[] @relation("FavoriteOrganizations")
2476
2510
 
2477
2511
  @@index([ownerId])
@@ -2495,6 +2529,10 @@ model OrganizationMember {
2495
2529
  canInvite Boolean @default(true)
2496
2530
  canCreateEvents Boolean @default(false)
2497
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?
2498
2536
  organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
2499
2537
  user User @relation("OrganizationMemberUser", fields: [userId], references: [id], onDelete: Cascade)
2500
2538
  eventRSVPs EventRSVP[]