@dative-gpi/foundation-shared-domain 1.0.54 → 1.0.56
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/enums/applications.ts +9 -0
- package/enums/index.ts +1 -1
- package/enums/messages.ts +16 -0
- package/models/index.ts +3 -2
- package/models/notifications/index.ts +2 -0
- package/models/notifications/notificationDetails.ts +10 -0
- package/models/notifications/notificationInfos.ts +50 -0
- package/package.json +2 -2
- package/enums/notifications.ts +0 -6
package/enums/applications.ts
CHANGED
package/enums/index.ts
CHANGED
|
@@ -11,7 +11,7 @@ export * from "./dates";
|
|
|
11
11
|
export * from "./filters";
|
|
12
12
|
export * from "./index";
|
|
13
13
|
export * from "./lists";
|
|
14
|
-
export * from "./
|
|
14
|
+
export * from "./messages";
|
|
15
15
|
export * from "./roles";
|
|
16
16
|
export * from "./times";
|
|
17
17
|
export * from "./users";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export enum MessageType {
|
|
2
|
+
None = 0,
|
|
3
|
+
UserApplicationCreation = 1,
|
|
4
|
+
UserOrganisationCreation = 2,
|
|
5
|
+
OrganisationCreation = 3,
|
|
6
|
+
UserApplicationAffectation = 4,
|
|
7
|
+
UserOrganisationAffectation = 5,
|
|
8
|
+
OrganisationAdminElevation = 6,
|
|
9
|
+
AccountInvitation = 7,
|
|
10
|
+
AccountValidation = 8,
|
|
11
|
+
PasswordReinitialisation = 9,
|
|
12
|
+
AlertCreation = 10,
|
|
13
|
+
AlertResolution = 11,
|
|
14
|
+
ConnectivityAlertCreation = 12,
|
|
15
|
+
ConnectivityAlertResolution = 13
|
|
16
|
+
}
|
package/models/index.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export * from "./applications";
|
|
2
2
|
export * from "./authTokens";
|
|
3
3
|
export * from "./images";
|
|
4
|
-
export * from "./languages";
|
|
4
|
+
export * from "./languages"; // No service
|
|
5
5
|
export * from "./locations";
|
|
6
|
+
export * from "./notifications";
|
|
6
7
|
export * from "./organisations";
|
|
7
|
-
export * from "./organisationTypes";
|
|
8
|
+
export * from "./organisationTypes"; // No service
|
|
8
9
|
export * from "./permissions";
|
|
9
10
|
export * from "./terminals";
|
|
10
11
|
export * from "./timeZones";
|
|
@@ -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,50 @@
|
|
|
1
|
+
import { type Criticity, type MessageType, type Scope } from "@dative-gpi/foundation-shared-domain/enums";
|
|
2
|
+
import { isoToEpoch } from "@dative-gpi/foundation-shared-domain/tools";
|
|
3
|
+
|
|
4
|
+
export class NotificationInfos {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
body: string;
|
|
8
|
+
pageUrl: string;
|
|
9
|
+
entityId?: string;
|
|
10
|
+
scope: Scope;
|
|
11
|
+
type: MessageType;
|
|
12
|
+
criticity: Criticity;
|
|
13
|
+
timestamp: number;
|
|
14
|
+
acknowledged: boolean | null;
|
|
15
|
+
acknowledgingTimestamp: number | null;
|
|
16
|
+
|
|
17
|
+
constructor(params: NotificationInfosDTO) {
|
|
18
|
+
this.id = params.id;
|
|
19
|
+
this.title = params.title;
|
|
20
|
+
this.body = params.body;
|
|
21
|
+
this.pageUrl = params.pageUrl;
|
|
22
|
+
this.entityId = params.entityId;
|
|
23
|
+
this.scope = params.scope as Scope;
|
|
24
|
+
this.type = params.type as MessageType;
|
|
25
|
+
this.criticity = params.criticity as Criticity;
|
|
26
|
+
this.timestamp = isoToEpoch(params.timestamp);
|
|
27
|
+
this.acknowledged = params.acknowledged;
|
|
28
|
+
this.acknowledgingTimestamp = params.acknowledgingTimestamp ?
|
|
29
|
+
isoToEpoch(params.acknowledgingTimestamp) : null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface NotificationInfosDTO {
|
|
34
|
+
id: string;
|
|
35
|
+
title: string;
|
|
36
|
+
body: string;
|
|
37
|
+
pageUrl: string;
|
|
38
|
+
entityId?: string;
|
|
39
|
+
scope: number;
|
|
40
|
+
type: number;
|
|
41
|
+
criticity: number;
|
|
42
|
+
timestamp: string;
|
|
43
|
+
acknowledged: boolean | null;
|
|
44
|
+
acknowledgingTimestamp: string | null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface NotificationFilters {
|
|
48
|
+
type?: MessageType | null;
|
|
49
|
+
criticity?: Criticity | null;
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-shared-domain",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.56",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"date-fns": "^3.6.0"
|
|
14
14
|
},
|
|
15
|
-
"gitHead": "
|
|
15
|
+
"gitHead": "c77d95e9a7724fa4a39d94b0b2bd0fa9d4fbdefc"
|
|
16
16
|
}
|