@bash-app/bash-common 30.13.0 → 30.15.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.13.0",
3
+ "version": "30.15.0",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1010,6 +1010,11 @@ model User {
1010
1010
  serviceBookingCheckout ServiceBookingCheckout[]
1011
1011
  promoter Promoter[]
1012
1012
  promoterStats PromoterStats?
1013
+
1014
+ blocksCreated BlockedUser[] @relation("UserBlocksMade")
1015
+ blocksReceived BlockedUser[] @relation("UserBlocksReceived")
1016
+ unblocksCreated UnblockedUserHistory[] @relation("UserUnblocksMade")
1017
+ unblocksReceived UnblockedUserHistory[] @relation("UserUnblocksReceived")
1013
1018
  }
1014
1019
 
1015
1020
  model Contact {
@@ -1026,6 +1031,33 @@ model Contact {
1026
1031
  @@index([contactEmail])
1027
1032
  }
1028
1033
 
1034
+ model BlockedUser {
1035
+ id String @id @default(cuid())
1036
+ blockerId String // User who blocked
1037
+ blockedId String // User who was blocked
1038
+ createdAt DateTime @default(now())
1039
+ updatedAt DateTime @updatedAt
1040
+
1041
+ // Relations
1042
+ blocker User @relation("UserBlocksMade", fields: [blockerId], references: [id], onDelete: Cascade)
1043
+ blocked User @relation("UserBlocksReceived", fields: [blockedId], references: [id], onDelete: Cascade)
1044
+
1045
+ // Unique constraint to prevent duplicate blocks
1046
+ @@unique([blockerId, blockedId])
1047
+ }
1048
+
1049
+ // UnblockedUserHistory for tracking when users are unblocked
1050
+ model UnblockedUserHistory {
1051
+ id String @id @default(cuid())
1052
+ blockerId String // User who had blocked
1053
+ blockedId String // User who was blocked but is now unblocked
1054
+ createdAt DateTime @default(now())
1055
+
1056
+ // Relations
1057
+ blocker User @relation("UserUnblocksMade", fields: [blockerId], references: [id], onDelete: Cascade)
1058
+ blocked User @relation("UserUnblocksReceived", fields: [blockedId], references: [id], onDelete: Cascade)
1059
+ }
1060
+
1029
1061
  // anyone that is invited to the bash, is an organizer of a bash, and or the creator/owner of the bash...for having others (including services) edit or post about a bash in the bashfeed
1030
1062
  model AssociatedBash {
1031
1063
  id String @id @default(cuid())