@dative-gpi/foundation-shared-domain 1.0.57 → 1.0.58-groupings

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.
@@ -9,7 +9,8 @@ export enum DashboardVariableType {
9
9
  None = 0,
10
10
  Number = 1,
11
11
  String = 2,
12
- TimeStep = 3
12
+ TimeStep = 3,
13
+ PlotPer = 4
13
14
  }
14
15
 
15
16
  export enum AutoRefresh {
package/enums/dates.ts CHANGED
@@ -42,6 +42,12 @@ export enum Days {
42
42
  AllDays = 7
43
43
  }
44
44
 
45
+ export enum DateType {
46
+ None = 0,
47
+ Local = 1,
48
+ UTC = 2
49
+ }
50
+
45
51
  export enum Months {
46
52
  None = 0,
47
53
  January = 1,
@@ -0,0 +1,5 @@
1
+ export enum DeviceExplorerElementType {
2
+ None = 0,
3
+ Group = 1,
4
+ DeviceOrganisation = 2
5
+ }
package/enums/index.ts CHANGED
@@ -8,6 +8,7 @@ export * from "./customProperties";
8
8
  export * from "./dashboards";
9
9
  export * from "./datas";
10
10
  export * from "./dates";
11
+ export * from "./deviceExplorerElements";
11
12
  export * from "./filters";
12
13
  export * from "./index";
13
14
  export * from "./lists";
@@ -15,3 +16,5 @@ export * from "./messages";
15
16
  export * from "./roles";
16
17
  export * from "./times";
17
18
  export * from "./users";
19
+ export * from "./widgetTemplates";
20
+ export * from "./reports";
@@ -0,0 +1,5 @@
1
+ export enum JobState {
2
+ None = 0,
3
+ Succeeded = 1,
4
+ Failed = 2,
5
+ }
@@ -0,0 +1,5 @@
1
+ export enum WidgetTemplateType {
2
+ None = 0,
3
+ Foundation = 1,
4
+ Extension = 2
5
+ }
@@ -1,4 +1,4 @@
1
- import { isoToEpoch } from "../../tools";
1
+ import { isoToEpoch } from "../../tools/datesTools";
2
2
 
3
3
  export class AuthTokenInfos {
4
4
  id: string;
@@ -1,7 +1,6 @@
1
1
  import { ImageInfos, type ImageInfosDTO } from "./imageInfos";
2
2
 
3
3
  export class ImageDetails extends ImageInfos {
4
-
5
4
  constructor(params: ImageDetailsDTO) {
6
5
  super(params);
7
6
  }
package/models/index.ts CHANGED
@@ -1,13 +1,15 @@
1
1
  export * from "./applications";
2
2
  export * from "./authTokens";
3
3
  export * from "./images";
4
- export * from "./languages"; // No service
4
+ export * from "./languages"; // No service
5
+ export * from "./legalInformations";
5
6
  export * from "./locations";
6
7
  export * from "./notifications";
7
8
  export * from "./organisations";
8
- export * from "./organisationTypes"; // No service
9
+ export * from "./organisationTypes"; // No service
9
10
  export * from "./permissions";
10
11
  export * from "./terminals";
11
12
  export * from "./timeZones";
12
13
  export * from "./translations";
14
+ export * from "./userLegalInformations";
13
15
  export * from "./users";
@@ -0,0 +1,2 @@
1
+ export * from "./legalInformationDetails";
2
+ export * from "./legalInformationInfos";
@@ -0,0 +1,10 @@
1
+ import { LegalInformationInfos, type LegalInformationInfosDTO } from "./legalInformationInfos";
2
+
3
+ export class LegalInformationDetails extends LegalInformationInfos {
4
+ constructor(params: LegalInformationDetailsDTO) {
5
+ super(params);
6
+ }
7
+ }
8
+
9
+ export interface LegalInformationDetailsDTO extends LegalInformationInfosDTO {
10
+ }
@@ -0,0 +1,17 @@
1
+ export class LegalInformationInfos {
2
+ id: string;
3
+ privacyPolicyId: string;
4
+ generalConditionsId: string;
5
+
6
+ constructor(params: LegalInformationInfosDTO) {
7
+ this.id = params.id;
8
+ this.privacyPolicyId = params.privacyPolicyId;
9
+ this.generalConditionsId = params.generalConditionsId;
10
+ }
11
+ }
12
+
13
+ export interface LegalInformationInfosDTO {
14
+ id: string;
15
+ privacyPolicyId: string;
16
+ generalConditionsId: string;
17
+ }
@@ -1,3 +1,2 @@
1
1
  export * from "./address";
2
- export * from "./area";
3
2
  export * from "./coordinates";
@@ -1,5 +1,7 @@
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";
1
+ import { type MessageType } from "../../enums/messages";
2
+ import { isoToEpoch } from "../../tools/datesTools";
3
+ import { Scope } from "../../enums/applications";
4
+ import { Criticity } from "../../enums/alerts";
3
5
 
4
6
  export class NotificationInfos {
5
7
  id: string;
@@ -32,6 +34,43 @@ export class NotificationInfos {
32
34
  this.acknowledgingTimestamp = params.acknowledgingTimestamp ?
33
35
  isoToEpoch(params.acknowledgingTimestamp) : null;
34
36
  }
37
+
38
+ static getFromAudience = (
39
+ notifications: NotificationInfos[],
40
+ application: boolean,
41
+ criticity: Criticity,
42
+ organisationId?: string | null,
43
+ userId?: string | null,
44
+ ): NotificationInfos[] => notifications.filter((n: NotificationInfos) => {
45
+ if (n.acknowledged) {
46
+ return false;
47
+ }
48
+ if (![Criticity.None, n.criticity].includes(criticity)) {
49
+ return false;
50
+ }
51
+ switch (n.audienceScope) {
52
+ case Scope.Organisation :
53
+ case Scope.UserOrganisation: return organisationId && n.organisationId && n.organisationId === organisationId;
54
+ case Scope.User : return userId && n.audienceId === userId;
55
+ case Scope.Application :
56
+ case Scope.Public : return application;
57
+
58
+ }
59
+ return false;
60
+ });
61
+
62
+ static getForDrawer = (
63
+ notifications: NotificationInfos[],
64
+ organisationId: string,
65
+ userId: string,
66
+ criticity: Criticity = Criticity.None
67
+ ): NotificationInfos[] => NotificationInfos.getFromAudience(notifications, true, criticity, organisationId, userId);
68
+
69
+ static getForCard = (
70
+ notifications: NotificationInfos[],
71
+ organisationId: string,
72
+ criticity: Criticity = Criticity.None
73
+ ): NotificationInfos[] => NotificationInfos.getFromAudience(notifications, false, criticity, organisationId, null);
35
74
  }
36
75
 
37
76
  export interface NotificationInfosDTO {
@@ -1,4 +1,4 @@
1
- import { isoToEpoch } from "../../tools";
1
+ import { isoToEpoch } from "../../tools/datesTools";
2
2
 
3
3
  export class TerminalInfos {
4
4
  id: string;
@@ -0,0 +1,2 @@
1
+ export * from "./userLegalInformationDetails";
2
+ export * from "./userLegalInformationInfos";
@@ -0,0 +1,14 @@
1
+ import { UserLegalInformationInfos, type UserLegalInformationInfosDTO } from "./userLegalInformationInfos";
2
+
3
+ export class UserLegalInformationDetails extends UserLegalInformationInfos {
4
+ constructor(params: UserLegalInformationDetailsDTO) {
5
+ super(params);
6
+ }
7
+ }
8
+
9
+ export interface UserLegalInformationDetailsDTO extends UserLegalInformationInfosDTO {
10
+ }
11
+
12
+ export interface CreateUserLegalInformationDTO {
13
+ legalInformationId: string;
14
+ }
@@ -0,0 +1,17 @@
1
+ export class UserLegalInformationInfos {
2
+ id: string;
3
+ userId: string;
4
+ legalInformationId: string;
5
+
6
+ constructor(params: UserLegalInformationInfosDTO) {
7
+ this.id = params.id;
8
+ this.userId = params.userId;
9
+ this.legalInformationId = params.legalInformationId;
10
+ }
11
+ }
12
+
13
+ export interface UserLegalInformationInfosDTO {
14
+ id: string;
15
+ userId: string;
16
+ legalInformationId: string;
17
+ }
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.57",
4
+ "version": "1.0.58-groupings",
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": "4445a164fed7501246674432eba3e8227c8bc827"
15
+ "gitHead": "563e78c4a0b3e8f73fdf8576e9d8bc0b626bc095"
16
16
  }
@@ -7,6 +7,10 @@ export const OPTIONS: { [key: string]: Intl.DateTimeFormatOptions } = {
7
7
  day: "2-digit",
8
8
  month: "long"
9
9
  },
10
+ dayMonthShortOnly: {
11
+ day: "2-digit",
12
+ month: "2-digit"
13
+ },
10
14
  shortDate: {
11
15
  day: "2-digit",
12
16
  month: "2-digit",
@@ -18,6 +22,12 @@ export const OPTIONS: { [key: string]: Intl.DateTimeFormatOptions } = {
18
22
  month: "long",
19
23
  year: "numeric"
20
24
  },
25
+ monthShortTime: {
26
+ day: "2-digit",
27
+ month: "2-digit",
28
+ hour: "2-digit",
29
+ minute: "2-digit"
30
+ },
21
31
  shortTime: {
22
32
  day: "2-digit",
23
33
  month: "2-digit",
@@ -0,0 +1,5 @@
1
+ export const getEnumEntries = (e: any) => {
2
+ return Object.keys(e)
3
+ .filter(key => isNaN(Number(key)))
4
+ .map(key => ({ key: key, value: e[key] }));
5
+ };
package/tools/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./autoRefresh";
1
2
  export * from "./datesTools";
2
- export * from "./single";
3
- export * from "./autoRefresh";
3
+ export * from "./enumTools";
4
+ export * from "./single";
@@ -1,7 +0,0 @@
1
- import { type Coordinates } from "./coordinates";
2
-
3
- export interface FSArea {
4
- id: string;
5
- color: string;
6
- coordinates: Coordinates[];
7
- }
@@ -1,39 +0,0 @@
1
- import { type NotificationInfos } from "../models";
2
- import { Criticity, Scope } from "../enums";
3
-
4
- export const getFromAudience = (
5
- notifications: NotificationInfos[],
6
- application: boolean,
7
- criticity: Criticity,
8
- organisationId?: string | null,
9
- userId?: string | null,
10
- ): NotificationInfos[] => notifications.filter((n: NotificationInfos) => {
11
- if (n.acknowledged) {
12
- return false;
13
- }
14
- if (![Criticity.None, n.criticity].includes(criticity)) {
15
- return false;
16
- }
17
- switch (n.audienceScope) {
18
- case Scope.Organisation :
19
- case Scope.UserOrganisation: return organisationId && n.organisationId && n.organisationId === organisationId;
20
- case Scope.User : return userId && n.audienceId === userId;
21
- case Scope.Application :
22
- case Scope.Public : return application;
23
-
24
- }
25
- return false;
26
- });
27
-
28
- export const getForDrawer = (
29
- notifications: NotificationInfos[],
30
- organisationId: string,
31
- userId: string,
32
- criticity: Criticity = Criticity.None
33
- ): NotificationInfos[] => getFromAudience(notifications, true, criticity, organisationId, userId);
34
-
35
- export const getForCard = (
36
- notifications: NotificationInfos[],
37
- organisationId: string,
38
- criticity: Criticity = Criticity.None
39
- ): NotificationInfos[] => getFromAudience(notifications, false, criticity, organisationId, null);