@dative-gpi/foundation-core-domain 0.0.214 → 0.0.216

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.
@@ -2,6 +2,7 @@ export * from "./actionEnums";
2
2
  export * from "./applicationEnums";
3
3
  export * from "./chartEnums";
4
4
  export * from "./customPropertyEnums";
5
+ export * from "./notificationEnums";
5
6
  export * from "./roleEnums";
6
7
  export * from "./sharedEnums";
7
8
  export * from "./userEnums";
@@ -0,0 +1,6 @@
1
+ export enum NotificationType {
2
+ None = 0,
3
+ CreateAlert = 1,
4
+ CreateConnectivityAlert = 2,
5
+ ResolveConnectivityAlert = 3
6
+ }
package/models/index.ts CHANGED
@@ -35,6 +35,7 @@ export * from "./locations";
35
35
  export * from "./manufacturers";
36
36
  export * from "./models";
37
37
  export * from "./modelStatuses"; // No service
38
+ export * from "./notifications";
38
39
  export * from "./organisations";
39
40
  export * from "./permissionCategories";
40
41
  export * from "./roleOrganisations";
@@ -0,0 +1,2 @@
1
+ export * from "./notificationDetails";
2
+ export * from "./notificationInfos";
@@ -0,0 +1,10 @@
1
+ import { NotificationInfos, type NotificationInfosDTO } from "./notificationInfos";
2
+
3
+ export class NotificationDetails extends NotificationInfos {
4
+ constructor(params: NotificationDetailsDTO) {
5
+ super(params);
6
+ }
7
+ }
8
+
9
+ export interface NotificationDetailsDTO extends NotificationInfosDTO {
10
+ }
@@ -0,0 +1,43 @@
1
+ import { type Criticity } from "@dative-gpi/foundation-shared-domain/models";
2
+ import { utcToEpoch } from "@dative-gpi/foundation-shared-domain/tools";
3
+
4
+ import { type NotificationType } from "../enums/notificationEnums";
5
+
6
+ export class NotificationInfos {
7
+ id: string;
8
+ title: string;
9
+ body: string;
10
+ pageUrl: string;
11
+ timestamp: number;
12
+ criticity: Criticity;
13
+ acknowledged: boolean | null;
14
+ acknowledgingTimestamp: number | null;
15
+
16
+ constructor(params: NotificationInfosDTO) {
17
+ this.id = params.id;
18
+ this.title = params.title;
19
+ this.body = params.body;
20
+ this.pageUrl = params.pageUrl;
21
+ this.timestamp = utcToEpoch(params.timestamp);
22
+ this.criticity = params.criticity as Criticity;
23
+ this.acknowledged = params.acknowledged;
24
+ this.acknowledgingTimestamp = params.acknowledgingTimestamp ?
25
+ utcToEpoch(params.acknowledgingTimestamp) : null;
26
+ }
27
+ }
28
+
29
+ export interface NotificationInfosDTO {
30
+ id: string;
31
+ title: string;
32
+ body: string;
33
+ pageUrl: string;
34
+ timestamp: string;
35
+ criticity: number;
36
+ acknowledged: boolean | null;
37
+ acknowledgingTimestamp: string | null;
38
+ }
39
+
40
+ export interface NotificationFilters {
41
+ type?: NotificationType | null;
42
+ acknowledged?: boolean | null;
43
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-core-domain",
3
3
  "sideEffects": false,
4
- "version": "0.0.214",
4
+ "version": "0.0.216",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -9,5 +9,5 @@
9
9
  "main": "index.ts",
10
10
  "author": "",
11
11
  "license": "ISC",
12
- "gitHead": "d13e07184215ee5604d7d0ee124c889edd741b0b"
12
+ "gitHead": "f4cd126d13779ae55d565f2b11efd30f338757f3"
13
13
  }