@bslau/hmm_prisma_schema 1.5.3 → 1.6.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": "@bslau/hmm_prisma_schema",
3
- "version": "1.5.3",
3
+ "version": "1.6.0",
4
4
  "main": "index.js",
5
5
  "author": "CIPA Development Team",
6
6
  "license": "ISC",
@@ -0,0 +1,32 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - A unique constraint covering the columns `[eventId]` on the table `EventTorpedoMaintenance` will be added. If there are existing duplicate values, this will fail.
5
+ - Added the required column `eventId` to the `EventTorpedoMaintenance` table without a default value. This is not possible if the table is not empty.
6
+
7
+ */
8
+ BEGIN TRY
9
+
10
+ BEGIN TRAN;
11
+
12
+ -- AlterTable
13
+ ALTER TABLE [dbo].[EventTorpedoMaintenance] ADD [eventId] INT NOT NULL;
14
+
15
+ -- CreateIndex
16
+ ALTER TABLE [dbo].[EventTorpedoMaintenance] ADD CONSTRAINT [EventTorpedoMaintenance_eventId_key] UNIQUE NONCLUSTERED ([eventId]);
17
+
18
+ -- AddForeignKey
19
+ ALTER TABLE [dbo].[EventTorpedoMaintenance] ADD CONSTRAINT [EventTorpedoMaintenance_eventId_fkey] FOREIGN KEY ([eventId]) REFERENCES [dbo].[EventTracker]([id]) ON DELETE NO ACTION ON UPDATE CASCADE;
20
+
21
+ COMMIT TRAN;
22
+
23
+ END TRY
24
+ BEGIN CATCH
25
+
26
+ IF @@TRANCOUNT > 0
27
+ BEGIN
28
+ ROLLBACK TRAN;
29
+ END;
30
+ THROW
31
+
32
+ END CATCH
@@ -0,0 +1,20 @@
1
+ BEGIN TRY
2
+
3
+ BEGIN TRAN;
4
+
5
+ -- AlterTable
6
+ ALTER TABLE [dbo].[NotificationDisplay] ADD [isDismissed] BIT NOT NULL CONSTRAINT [NotificationDisplay_isDismissed_df] DEFAULT 0,
7
+ [userId] NVARCHAR(1000);
8
+
9
+ COMMIT TRAN;
10
+
11
+ END TRY
12
+ BEGIN CATCH
13
+
14
+ IF @@TRANCOUNT > 0
15
+ BEGIN
16
+ ROLLBACK TRAN;
17
+ END;
18
+ THROW
19
+
20
+ END CATCH
@@ -144,24 +144,27 @@ model EventTorpedoCapacity {
144
144
  ///
145
145
  /// Capture when a Torpedo undergoes maintenance. (when a Torpedo is moved to the R+M Break Station for Maintenance.)
146
146
  model EventTorpedoMaintenance {
147
- id Int @id @default(autoincrement())
148
- maintenanceDate DateTime @db.DateTimeOffset
147
+ id Int @id @default(autoincrement())
148
+ event EventTracker @relation(fields: [eventId], references: [id])
149
+ eventId Int @unique
150
+ maintenanceDate DateTime @db.DateTimeOffset
149
151
  torpedoId Int
150
- torpedo Torpedo @relation(fields: [torpedoId], references: [torpedoId])
151
- createdAt DateTime @default(now())
152
- updatedAt DateTime @updatedAt
152
+ torpedo Torpedo @relation(fields: [torpedoId], references: [torpedoId])
153
+ createdAt DateTime @default(now())
154
+ updatedAt DateTime @updatedAt
153
155
  }
154
156
 
155
157
  /// **EVENT TRACKER**
156
158
  ///
157
159
  /// Represents a generic system _Event_, which maps to its model instance.
158
160
  model EventTracker {
159
- id Int @id @default(autoincrement())
160
- eventTime DateTime @db.DateTimeOffset
161
- eventType String
162
- userId String?
163
- torpedoMovement EventTorpedoMovement?
164
- torpedoCapacity EventTorpedoCapacity?
161
+ id Int @id @default(autoincrement())
162
+ eventTime DateTime @db.DateTimeOffset
163
+ eventType String
164
+ userId String?
165
+ torpedoMovement EventTorpedoMovement?
166
+ torpedoCapacity EventTorpedoCapacity?
167
+ torpedoMaintenance EventTorpedoMaintenance?
165
168
  }
166
169
 
167
170
  /// **HOT METAL HANDLER COMMENT**
@@ -512,13 +515,18 @@ model NotificationCategory {
512
515
  /// ***HMM Display Modes for Notifications***
513
516
  ///
514
517
  /// These display modes define how these notifications are displayed to the User
518
+ ///
519
+ /// Properties for this model also determine whether the displayed notification
520
+ /// is considered a "System" display for boradcast, or a "User" display only
521
+ /// intended for an individual client to receive.
515
522
  model NotificationDisplay {
516
523
  id Int @id @default(autoincrement())
517
524
  displayModeId Int
518
525
  notificationDisplayMode NotificationDisplayMode @relation(fields: [displayModeId], references: [id])
519
526
  notification Notification @relation(fields: [notificationId], references: [id], onDelete: NoAction, onUpdate: Cascade)
520
527
  notificationId Int
521
- // status Boolean @default(false) NOTES: Probably add something like this later to check for example if a notification has been acknowledged by the user
528
+ userId String?
529
+ isDismissed Boolean @default(false)
522
530
  }
523
531
 
524
532
  /// ** HMM Display Mode Definitions **