@bash-app/bash-common 30.112.0 → 30.113.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.112.0",
3
+ "version": "30.113.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",
@@ -331,6 +331,28 @@ model Reminder {
331
331
  remindWho User? @relation("RemindersAssignedToMe", fields: [remindWhoId], references: [id], onDelete: Cascade)
332
332
  }
333
333
 
334
+ model SentReminder {
335
+ id String @id @default(cuid())
336
+ userId String
337
+ bashEventId String?
338
+ serviceBookingId String?
339
+ invitationId String?
340
+ reminderType String // 'HOST_IMPROVEMENT_7D', 'HOST_IMPROVEMENT_3D', 'BOOKING_7D', 'BOOKING_24H', 'BOOKING_3H', 'RSVP_3D', 'RSVP_1D', 'PENDING_BOOKING_2D', 'PENDING_BOOKING_5D'
341
+ sentAt DateTime @default(now())
342
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
343
+ bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
344
+ serviceBooking ServiceBooking? @relation(fields: [serviceBookingId], references: [id], onDelete: Cascade)
345
+ invitation Invitation? @relation(fields: [invitationId], references: [id], onDelete: Cascade)
346
+
347
+ @@unique([userId, bashEventId, serviceBookingId, invitationId, reminderType])
348
+ @@index([userId])
349
+ @@index([bashEventId])
350
+ @@index([serviceBookingId])
351
+ @@index([invitationId])
352
+ @@index([reminderType])
353
+ @@index([sentAt])
354
+ }
355
+
334
356
  model BashEventPromoCode {
335
357
  id String @id @default(cuid())
336
358
  code String
@@ -462,28 +484,29 @@ model Invitation {
462
484
  sentTo User? @relation("InvitationsSentToMe", fields: [sentToId], references: [id], onDelete: Cascade)
463
485
  notifications Notification[]
464
486
  tickets Ticket[] @relation("TicketsForInvitation")
487
+ sentReminders SentReminder[]
465
488
 
466
489
  @@index([email])
467
490
  }
468
491
 
469
492
  model BashEvent {
470
- id String @id @default(cuid())
471
- source BashEventSource @default(Bash)
493
+ id String @id @default(cuid())
494
+ source BashEventSource @default(Bash)
472
495
  title String
473
- slug String? @unique
496
+ slug String? @unique
474
497
  creatorId String
475
- createdAt DateTime? @default(now())
476
- isApproved Boolean? @default(false)
498
+ createdAt DateTime? @default(now())
499
+ isApproved Boolean? @default(false)
477
500
  description String?
478
- eventType String @default("Other")
501
+ eventType String @default("Other")
479
502
  timezone String?
480
503
  startDateTime DateTime?
481
504
  endDateTime DateTime?
482
505
  waiverUrl String?
483
- waiverRequired Boolean @default(false)
484
- waiverDisplayType String? @default("inline")
485
- targetAudienceId String? @unique
486
- amountOfGuestsId String? @unique
506
+ waiverRequired Boolean @default(false)
507
+ waiverDisplayType String? @default("inline")
508
+ targetAudienceId String? @unique
509
+ amountOfGuestsId String? @unique
487
510
  vibe String?
488
511
  occasion String?
489
512
  dress String?
@@ -492,7 +515,7 @@ model BashEvent {
492
515
  eventFormat EventFormat? // Derived from location and videoLink: In-Person, Virtual, or Hybrid
493
516
  nonProfit Boolean?
494
517
  nonProfitId String?
495
- privacy Privacy @default(Public)
518
+ privacy Privacy @default(Public)
496
519
  capacity Int?
497
520
  location String?
498
521
  street String?
@@ -500,7 +523,7 @@ model BashEvent {
500
523
  state String?
501
524
  zipCode String?
502
525
  country String?
503
- status BashStatus @default(Draft)
526
+ status BashStatus @default(Draft)
504
527
  tags String[]
505
528
  coverPhoto String?
506
529
  clubId String?
@@ -511,24 +534,24 @@ model BashEvent {
511
534
  isFeatured Boolean?
512
535
  isTrending Boolean?
513
536
  venueId String?
514
- averageRating Float? @default(0)
515
- totalRatings Int? @default(0) // Total count of all ratings (Review + BashFeedRating)
516
- totalReviews Int? @default(0) // Count of Review records (anonymous quick ratings)
517
- totalFeedRatings Int? @default(0) // Count of BashFeedRating records (from posts)
518
- allowDonations Boolean? @default(true)
537
+ averageRating Float? @default(0)
538
+ totalRatings Int? @default(0) // Total count of all ratings (Review + BashFeedRating)
539
+ totalReviews Int? @default(0) // Count of Review records (anonymous quick ratings)
540
+ totalFeedRatings Int? @default(0) // Count of BashFeedRating records (from posts)
541
+ allowDonations Boolean? @default(true)
519
542
  suggestedDonationAmount Int?
520
543
  donationDetails String?
521
- absorbDonationFees Boolean @default(false)
522
- absorbTicketFees Boolean @default(false)
523
- showAttendees Boolean @default(true)
544
+ absorbDonationFees Boolean @default(false)
545
+ absorbTicketFees Boolean @default(false)
546
+ showAttendees Boolean @default(true)
524
547
  servicePreferences Json? // New tiered status: { "Entertainment": "need", "Sponsors": "booked_closed", ... }
525
548
  bookedServices Json? // Booked service details: { "Entertainment": { serviceId: "...", providerId: "...", bookedAt: "..." }, ... }
526
549
  serviceVisibility Json? // DEPRECATED: Use servicePreferences instead. Kept for backward compatibility during migration.
527
550
  originalCreatorId String?
528
551
  transferredAt DateTime?
529
552
  transferredFromId String?
530
- transferCount Int @default(0)
531
- startTimeLocked Boolean @default(false)
553
+ transferCount Int @default(0)
554
+ startTimeLocked Boolean @default(false)
532
555
  p2pPaymentMethod String?
533
556
  venmoUsername String?
534
557
  venmoQRCodeUrl String?
@@ -543,48 +566,50 @@ model BashEvent {
543
566
  itinerary Json? // Array of { id: string, title: string, startTime: string, endTime: string, description?: string }
544
567
  associatedBashesReferencingMe AssociatedBash[]
545
568
  comments BashComment[]
546
- amountOfGuests AmountOfGuests? @relation(fields: [amountOfGuestsId], references: [id], onDelete: Cascade)
547
- club Club? @relation(fields: [clubId], references: [id])
548
- creator User @relation("CreatedEvent", fields: [creatorId], references: [id], onDelete: Cascade)
549
- targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id], onDelete: Cascade)
550
- transferredFrom User? @relation("TransferredFrom", fields: [transferredFromId], references: [id])
551
- venue Venue? @relation(fields: [venueId], references: [id])
569
+ amountOfGuests AmountOfGuests? @relation(fields: [amountOfGuestsId], references: [id], onDelete: Cascade)
570
+ club Club? @relation(fields: [clubId], references: [id])
571
+ creator User @relation("CreatedEvent", fields: [creatorId], references: [id], onDelete: Cascade)
572
+ targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id], onDelete: Cascade)
573
+ transferredFrom User? @relation("TransferredFrom", fields: [transferredFromId], references: [id])
574
+ venue Venue? @relation(fields: [venueId], references: [id])
552
575
  messages BashEventMessage[]
553
576
  transferRequests BashEventTransferRequest[]
577
+ updateNotificationQueue EventUpdateNotificationQueue[]
554
578
  slugHistory BashSlugHistory[]
555
579
  checkouts Checkout[]
556
580
  competitions Competition[]
557
581
  coordinates Coordinates[]
558
582
  links EventLink[]
559
583
  eventTasks EventTask[]
560
- exhibitorBookingRequests ExhibitorBookingRequest[] @relation("ExhibitorBookingEvent")
584
+ exhibitorBookingRequests ExhibitorBookingRequest[] @relation("ExhibitorBookingEvent")
561
585
  investments Investment[]
562
586
  invitations Invitation[]
563
587
  notificationsReferencingMe Notification[]
588
+ sentReminders SentReminder[]
564
589
  recurrence Recurrence?
565
590
  reviews Review[]
566
591
  serviceBookings ServiceBooking[]
567
- sponsorBookingRequests SponsorBookingRequest[] @relation("SponsorBookingEvent")
592
+ sponsorBookingRequests SponsorBookingRequest[] @relation("SponsorBookingEvent")
568
593
  sponsorships SponsoredEvent[]
569
594
  tickets Ticket[]
570
595
  ticketTiers TicketTier[]
571
596
  favoritedBy UserFavorite[]
572
597
  userPromoCodeRedemption UserPromoCodeRedemption[]
573
598
  userReport UserReport[]
574
- vendorBookingRequests VendorBookingRequest[] @relation("VendorBookingEvent")
575
- media Media[] @relation("BashEventToMedia")
576
- associatedServicesReferencingMe Service[] @relation("BashEventToService")
599
+ vendorBookingRequests VendorBookingRequest[] @relation("VendorBookingEvent")
600
+ media Media[] @relation("BashEventToMedia")
601
+ associatedServicesReferencingMe Service[] @relation("BashEventToService")
577
602
  userConnections UserConnection[]
578
603
  aiRecommendationLogs AIRecommendationLog[]
579
604
  aiRecommendationCaches AIRecommendationCache[]
580
605
  // Template tracking
581
606
  templateId String?
582
- template BashEventTemplate? @relation("CreatedFromTemplate", fields: [templateId], references: [id])
607
+ template BashEventTemplate? @relation("CreatedFromTemplate", fields: [templateId], references: [id])
583
608
  // Recurring event fields (for child occurrences)
584
- isRecurringChild Boolean @default(false)
609
+ isRecurringChild Boolean @default(false)
585
610
  parentEventId String?
586
- parentEvent BashEvent? @relation("RecurringEventChildren", fields: [parentEventId], references: [id], onDelete: SetNull)
587
- childEvents BashEvent[] @relation("RecurringEventChildren")
611
+ parentEvent BashEvent? @relation("RecurringEventChildren", fields: [parentEventId], references: [id], onDelete: SetNull)
612
+ childEvents BashEvent[] @relation("RecurringEventChildren")
588
613
  occurrenceIndex Int? // 1, 2, 3... for child events
589
614
 
590
615
  // BashFeed Relations
@@ -1253,6 +1278,7 @@ model User {
1253
1278
  promoterStats PromoterStats?
1254
1279
  remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
1255
1280
  remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
1281
+ sentReminders SentReminder[]
1256
1282
  reviews Review[]
1257
1283
  firstFreeListingId String?
1258
1284
  createdServices Service[] @relation("CreatedService")
@@ -2359,6 +2385,7 @@ model ServiceBooking {
2359
2385
  messages ServiceBookingMessage[]
2360
2386
  packages ServiceBookingPackage[]
2361
2387
  commissions BookingCommission[] @relation("BookingCommissions")
2388
+ sentReminders SentReminder[]
2362
2389
 
2363
2390
  @@index([status])
2364
2391
  @@index([creatorId])
@@ -2717,6 +2744,24 @@ model BashEventTransferRequest {
2717
2744
  @@index([fromUserId])
2718
2745
  }
2719
2746
 
2747
+ model EventUpdateNotificationQueue {
2748
+ id String @id @default(cuid())
2749
+ bashEventId String
2750
+ scheduledFor DateTime // When to send the notification (5 minutes after last change)
2751
+ changes Json // Array of change objects: [{ field, oldValue, newValue, description }]
2752
+ oldEventSnapshot Json // Complete snapshot of event before any changes
2753
+ createdAt DateTime @default(now())
2754
+ updatedAt DateTime @updatedAt
2755
+ status String @default("pending") // pending, sent, cancelled
2756
+ sentAt DateTime?
2757
+ errorMessage String?
2758
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
2759
+
2760
+ @@index([bashEventId])
2761
+ @@index([scheduledFor, status])
2762
+ @@index([status])
2763
+ }
2764
+
2720
2765
  model BlogPost {
2721
2766
  id String @id @default(cuid())
2722
2767
  title String