dt-common-device 13.0.23 → 13.0.25
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/dist/entities/connection/IConnection.d.ts +2 -1
- package/dist/entities/connection/IConnection.js +1 -0
- package/package.json +4 -4
- package/dist/admin/Admin.repository.d.ts +0 -7
- package/dist/admin/Admin.service.d.ts +0 -5
- package/dist/admin/index.d.ts +0 -1
- package/dist/alerts/AlertBuilder.example.d.ts +0 -11
- package/dist/alerts/AlertService.example.d.ts +0 -55
- package/dist/audit/AuditProperties.d.ts +0 -16
- package/dist/chronicle/Cronicle.service.d.ts +0 -9
- package/dist/chronicle/IChronicle.interface.d.ts +0 -14
- package/dist/chronicle/ICronicle.interface.d.ts +0 -15
- package/dist/chronicle/chronicle.service.d.ts +0 -4
- package/dist/chronicle/index.d.ts +0 -2
- package/dist/connection/Connection.repository.d.ts +0 -8
- package/dist/connection/Connection.service.d.ts +0 -8
- package/dist/connection/IConnection.d.ts +0 -28
- package/dist/connection/index.d.ts +0 -2
- package/dist/copilotQueue/examples/CopilotQueue.example.d.ts +0 -37
- package/dist/copilotQueue/examples/index.d.ts +0 -1
- package/dist/device/cloud/entities/CloudConnection.d.ts +0 -6
- package/dist/device/cloud/entities/CloudDevice.d.ts +0 -16
- package/dist/device/cloud/entities/CloudDeviceService.d.ts +0 -5
- package/dist/device/cloud/entities/DeviceFactory.d.ts +0 -7
- package/dist/device/cloud/entities/index.d.ts +0 -3
- package/dist/device/cloud/interface.d.ts +0 -101
- package/dist/device/cloud/interfaces/ICloudConnection.d.ts +0 -5
- package/dist/device/cloud/interfaces/ICloudDevice.d.ts +0 -9
- package/dist/device/cloud/interfaces/ICloudDeviceService.d.ts +0 -4
- package/dist/device/cloud/interfaces/IConnectionService.d.ts +0 -7
- package/dist/device/cloud/interfaces/IDeviceConnectionService.d.ts +0 -7
- package/dist/device/cloud/interfaces/IDeviceFactory.d.ts +0 -4
- package/dist/device/cloud/interfaces/IDeviceService.d.ts +0 -8
- package/dist/device/cloud/interfaces/IDevicesService.d.ts +0 -9
- package/dist/device/cloud/interfaces/IHubService.d.ts +0 -5
- package/dist/device/cloud/interfaces/IRawDataTransformer.d.ts +0 -4
- package/dist/device/cloud/interfaces/IRawDevice.d.ts +0 -17
- package/dist/device/cloud/interfaces/index.d.ts +0 -5
- package/dist/device/cloud/services/CloudDevice.service.d.ts +0 -5
- package/dist/device/cloud/services/Connection.service.d.ts +0 -8
- package/dist/device/cloud/services/Device.service.d.ts +0 -39
- package/dist/device/cloud/services/DeviceCloudService.d.ts +0 -42
- package/dist/device/cloud/services/DeviceHub.service.d.ts +0 -3
- package/dist/device/cloud/services/Hub.service.d.ts +0 -25
- package/dist/device/cloud/services/SmartThingsDeviceService.d.ts +0 -38
- package/dist/device/cloud/services/SmartThingsDeviceService.js +0 -52
- package/dist/device/cloud/services/index.d.ts +0 -2
- package/dist/device/cloud/types.d.ts +0 -52
- package/dist/device/cloud/types.js +0 -15
- package/dist/device/index.d.ts +0 -4
- package/dist/device/local/entities/AlertBuilder.d.ts +0 -87
- package/dist/device/local/entities/AlertBuilder.example.d.ts +0 -11
- package/dist/device/local/entities/IssueBuilder.d.ts +0 -109
- package/dist/device/local/entities/IssueBuilder.example.d.ts +0 -16
- package/dist/device/local/entities/IssueBuilder.example.js +0 -196
- package/dist/device/local/entities/IssueBuilder.js +0 -237
- package/dist/device/local/entities/index.d.ts +0 -2
- package/dist/device/local/events/EventHandler.d.ts +0 -11
- package/dist/device/local/events/Events.d.ts +0 -54
- package/dist/device/local/events/index.d.ts +0 -2
- package/dist/device/local/handler/EventHandler.d.ts +0 -7
- package/dist/device/local/interface.d.ts +0 -0
- package/dist/device/local/interfaces/IConnection.d.ts +0 -26
- package/dist/device/local/interfaces/IDevice.d.ts +0 -68
- package/dist/device/local/interfaces/IDtDevice.d.ts +0 -16
- package/dist/device/local/interfaces/IHub.d.ts +0 -46
- package/dist/device/local/interfaces/IProperty.d.ts +0 -29
- package/dist/device/local/interfaces/ISchedule.d.ts +0 -25
- package/dist/device/local/interfaces/index.d.ts +0 -3
- package/dist/device/local/models/Alert.model.d.ts +0 -28
- package/dist/device/local/models/Issue.model.d.ts +0 -28
- package/dist/device/local/repository/Alert.repository.d.ts +0 -106
- package/dist/device/local/repository/Connection.repository.d.ts +0 -8
- package/dist/device/local/repository/Device.repository.d.ts +0 -30
- package/dist/device/local/repository/Hub.repository.d.ts +0 -13
- package/dist/device/local/repository/Issue.repository.d.ts +0 -113
- package/dist/device/local/repository/Property.repository.d.ts +0 -8
- package/dist/device/local/repository/Property.repository.js +0 -95
- package/dist/device/local/repository/Schedule.repository.d.ts +0 -9
- package/dist/device/local/repository/Schedule.repository.js +0 -109
- package/dist/device/local/services/Alert.service.d.ts +0 -137
- package/dist/device/local/services/AlertService.example.d.ts +0 -55
- package/dist/device/local/services/Connection.service.d.ts +0 -8
- package/dist/device/local/services/Device.service.d.ts +0 -40
- package/dist/device/local/services/DeviceHub.service.d.ts +0 -11
- package/dist/device/local/services/Hub.service.d.ts +0 -12
- package/dist/device/local/services/Issue.service.d.ts +0 -168
- package/dist/device/local/services/Issue.service.js +0 -642
- package/dist/device/local/services/IssueService.example.d.ts +0 -68
- package/dist/device/local/services/IssueService.example.js +0 -177
- package/dist/device/local/services/Property.service.d.ts +0 -8
- package/dist/device/local/services/Property.service.js +0 -36
- package/dist/device/local/services/Schedule.service.d.ts +0 -9
- package/dist/device/local/services/Schedule.service.js +0 -26
- package/dist/device/local/services/index.d.ts +0 -3
- package/dist/entities/accessGroup/AccessGroup.repository.d.ts +0 -5
- package/dist/entities/accessGroup/AccessGroup.service.d.ts +0 -5
- package/dist/entities/accessGroup/IAccessGroup.d.ts +0 -14
- package/dist/entities/accessGroup/index.d.ts +0 -2
- package/dist/entities/device/local/repository/DeviceProfile.repository.d.ts +0 -5
- package/dist/entities/guest/Guest.repository.d.ts +0 -6
- package/dist/entities/guest/Guest.service.d.ts +0 -6
- package/dist/entities/guest/IGuest.d.ts +0 -12
- package/dist/entities/guest/index.d.ts +0 -2
- package/dist/entities/schedules/ISchedule.d.ts +0 -14
- package/dist/entities/schedules/Schedule.repository.d.ts +0 -6
- package/dist/entities/schedules/Schedule.repository.js +0 -74
- package/dist/entities/schedules/Schedule.service.d.ts +0 -6
- package/dist/entities/schedules/Schedule.service.js +0 -104
- package/dist/entities/schedules/index.d.ts +0 -2
- package/dist/entities/user/IUser.d.ts +0 -15
- package/dist/entities/user/IUser.js +0 -2
- package/dist/entities/user/User.repository.d.ts +0 -5
- package/dist/entities/user/User.repository.js +0 -68
- package/dist/entities/user/User.service.d.ts +0 -6
- package/dist/entities/user/User.service.js +0 -103
- package/dist/entities/zone/IZone.d.ts +0 -10
- package/dist/entities/zone/IZone.js +0 -2
- package/dist/entities/zone/Zone.repository.d.ts +0 -6
- package/dist/entities/zone/Zone.repository.js +0 -77
- package/dist/entities/zone/Zone.service.d.ts +0 -6
- package/dist/entities/zone/Zone.service.js +0 -104
- package/dist/entities/zone/index.d.ts +0 -2
- package/dist/issues/IssueBuilder.example.d.ts +0 -16
- package/dist/issues/IssueBuilder.example.js +0 -196
- package/dist/issues/IssueService.example.d.ts +0 -68
- package/dist/issues/IssueService.example.js +0 -292
- package/dist/pms/IPms.d.ts +0 -6
- package/dist/pms/index.d.ts +0 -1
- package/dist/pms/webhookQueue/examples/index.d.ts +0 -2
- package/dist/pms/webhookQueue/examples/pms-integration.d.ts +0 -65
- package/dist/pms/webhookQueue/examples/pms-integration.js +0 -254
- package/dist/pms/webhookQueue/examples/usage.d.ts +0 -7
- package/dist/pms/webhookQueue/examples/usage.js +0 -175
- package/dist/pms/webhookQueue/index.d.ts +0 -3
- package/dist/pms/webhookQueue/interfaces/IWebhookQueue.d.ts +0 -33
- package/dist/pms/webhookQueue/interfaces/IWebhookQueue.js +0 -2
- package/dist/pms/webhookQueue/interfaces/IWebhookWorker.d.ts +0 -38
- package/dist/pms/webhookQueue/interfaces/IWebhookWorker.js +0 -2
- package/dist/pms/webhookQueue/interfaces/index.d.ts +0 -1
- package/dist/pms/webhookQueue/services/WebhookQueueFactory.d.ts +0 -38
- package/dist/pms/webhookQueue/services/WebhookQueueFactory.js +0 -131
- package/dist/pms/webhookQueue/services/WebhookQueueIntegration.d.ts +0 -70
- package/dist/pms/webhookQueue/services/WebhookQueueIntegration.js +0 -207
- package/dist/pms/webhookQueue/services/WebhookQueueService.d.ts +0 -45
- package/dist/pms/webhookQueue/services/WebhookQueueService.js +0 -270
- package/dist/pms/webhookQueue/services/WebhookWorker.d.ts +0 -37
- package/dist/pms/webhookQueue/services/WebhookWorker.js +0 -201
- package/dist/pms/webhookQueue/services/index.d.ts +0 -1
- package/dist/pms/webhookQueue/types/index.d.ts +0 -1
- package/dist/pms/webhookQueue/types/webhook.types.d.ts +0 -39
- package/dist/pms/webhookQueue/types/webhook.types.js +0 -2
- package/dist/property/IProperty.d.ts +0 -29
- package/dist/property/Property.repository.d.ts +0 -8
- package/dist/property/Property.repository.js +0 -109
- package/dist/property/Property.service.d.ts +0 -8
- package/dist/property/Property.service.js +0 -124
- package/dist/property/index.d.ts +0 -2
- package/dist/queue/interfaces/IHttpRequestJob.d.ts +0 -9
- package/dist/types/alert.types.d.ts +0 -57
- package/dist/types/config.types.d.ts +0 -19
- package/dist/types/index.d.ts +0 -3
- package/dist/types/issue.types.d.ts +0 -90
- package/dist/types/issue.types.js +0 -40
- package/dist/utils/http-utils.d.ts +0 -13
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { IAlertDocument } from "../models/Alert.model";
|
|
2
|
-
import { CreateAlertData, UpdateAlertData, AlertCategory, AlertSeverity, EntityType } from "../../../types/alert.types";
|
|
3
|
-
export declare class AlertRepository {
|
|
4
|
-
/**
|
|
5
|
-
* Create a new alert
|
|
6
|
-
*/
|
|
7
|
-
create(alertData: CreateAlertData): Promise<IAlertDocument>;
|
|
8
|
-
/**
|
|
9
|
-
* Find alert by ID
|
|
10
|
-
*/
|
|
11
|
-
findById(id: string, includeDeleted?: boolean): Promise<IAlertDocument | null>;
|
|
12
|
-
/**
|
|
13
|
-
* Find all alerts with filters
|
|
14
|
-
*/
|
|
15
|
-
findAll(filters?: {
|
|
16
|
-
propertyId?: string;
|
|
17
|
-
category?: AlertCategory;
|
|
18
|
-
severity?: AlertSeverity;
|
|
19
|
-
entityType?: EntityType;
|
|
20
|
-
entityId?: string;
|
|
21
|
-
isActive?: boolean;
|
|
22
|
-
isRead?: boolean;
|
|
23
|
-
includeDeleted?: boolean;
|
|
24
|
-
limit?: number;
|
|
25
|
-
skip?: number;
|
|
26
|
-
sort?: {
|
|
27
|
-
[key: string]: 1 | -1;
|
|
28
|
-
};
|
|
29
|
-
}): Promise<IAlertDocument[]>;
|
|
30
|
-
/**
|
|
31
|
-
* Update an alert
|
|
32
|
-
*/
|
|
33
|
-
update(id: string, updateData: UpdateAlertData): Promise<IAlertDocument | null>;
|
|
34
|
-
/**
|
|
35
|
-
* Soft delete an alert
|
|
36
|
-
*/
|
|
37
|
-
softDelete(id: string, deletedBy: string): Promise<boolean>;
|
|
38
|
-
/**
|
|
39
|
-
* Permanently delete an alert
|
|
40
|
-
*/
|
|
41
|
-
hardDelete(id: string): Promise<boolean>;
|
|
42
|
-
/**
|
|
43
|
-
* Count alerts with filters
|
|
44
|
-
*/
|
|
45
|
-
count(filters?: {
|
|
46
|
-
propertyId?: string;
|
|
47
|
-
category?: AlertCategory;
|
|
48
|
-
severity?: AlertSeverity;
|
|
49
|
-
entityType?: EntityType;
|
|
50
|
-
entityId?: string;
|
|
51
|
-
isActive?: boolean;
|
|
52
|
-
isRead?: boolean;
|
|
53
|
-
includeDeleted?: boolean;
|
|
54
|
-
}): Promise<number>;
|
|
55
|
-
/**
|
|
56
|
-
* Find alerts by property
|
|
57
|
-
*/
|
|
58
|
-
findByProperty(propertyId: string, includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
59
|
-
/**
|
|
60
|
-
* Find alerts by entity
|
|
61
|
-
*/
|
|
62
|
-
findByEntity(entityId: string, entityType: EntityType, includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
63
|
-
/**
|
|
64
|
-
* Find alerts by category
|
|
65
|
-
*/
|
|
66
|
-
findByCategory(category: AlertCategory, includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
67
|
-
/**
|
|
68
|
-
* Find alerts by severity
|
|
69
|
-
*/
|
|
70
|
-
findBySeverity(severity: AlertSeverity, includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
71
|
-
/**
|
|
72
|
-
* Find active alerts
|
|
73
|
-
*/
|
|
74
|
-
findActive(includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
75
|
-
/**
|
|
76
|
-
* Find unread alerts
|
|
77
|
-
*/
|
|
78
|
-
findUnread(includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
79
|
-
/**
|
|
80
|
-
* Find snoozed alerts
|
|
81
|
-
*/
|
|
82
|
-
findSnoozed(includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
83
|
-
/**
|
|
84
|
-
* Find expired snooze alerts
|
|
85
|
-
*/
|
|
86
|
-
findExpiredSnooze(includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
87
|
-
/**
|
|
88
|
-
* Get alert statistics
|
|
89
|
-
*/
|
|
90
|
-
getStatistics(propertyId?: string): Promise<{
|
|
91
|
-
total: number;
|
|
92
|
-
active: number;
|
|
93
|
-
unread: number;
|
|
94
|
-
snoozed: number;
|
|
95
|
-
bySeverity: Record<AlertSeverity, number>;
|
|
96
|
-
byCategory: Record<AlertCategory, number>;
|
|
97
|
-
}>;
|
|
98
|
-
/**
|
|
99
|
-
* Bulk update alerts
|
|
100
|
-
*/
|
|
101
|
-
bulkUpdate(ids: string[], updateData: Partial<UpdateAlertData>): Promise<number>;
|
|
102
|
-
/**
|
|
103
|
-
* Bulk soft delete alerts
|
|
104
|
-
*/
|
|
105
|
-
bulkSoftDelete(ids: string[], deletedBy: string): Promise<number>;
|
|
106
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { IConnection } from "../interfaces/IConnection";
|
|
2
|
-
export declare class ConnectionRepository {
|
|
3
|
-
private readonly pool;
|
|
4
|
-
constructor();
|
|
5
|
-
createConnection(data: Partial<IConnection>): Promise<IConnection>;
|
|
6
|
-
getConnectionById(connectionId: string): Promise<IConnection>;
|
|
7
|
-
updateConnection(connectionId: string, data: Partial<IConnection>): Promise<any>;
|
|
8
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { IDevice, IStatus, IStatusQuery } from "../interfaces/IDevice";
|
|
2
|
-
import { IDtDevice } from "../interfaces/IDtDevice";
|
|
3
|
-
export declare class DeviceRepository {
|
|
4
|
-
private readonly postgres;
|
|
5
|
-
private readonly axiosInstance;
|
|
6
|
-
constructor();
|
|
7
|
-
createDevice(body: IDevice): Promise<IDevice>;
|
|
8
|
-
getDevice(deviceId: string, withHubDetails?: boolean): Promise<IDevice>;
|
|
9
|
-
updateDevice(deviceId: string, body: any): Promise<IDevice>;
|
|
10
|
-
updateDevices(query: any, updateData: any): Promise<any>;
|
|
11
|
-
deleteDevice(deviceId: string): Promise<void>;
|
|
12
|
-
getDevices(deviceIds: string[], withHubDetails?: boolean): Promise<IDevice[]>;
|
|
13
|
-
getPropertyDevices(propertyId: string, selectDeviceId?: boolean, type?: string, withHubDetails?: boolean): Promise<IDevice[]>;
|
|
14
|
-
getPropertyDeviceIds(propertyId: string, selectDeviceId: boolean | undefined, manufacturer: string): Promise<any>;
|
|
15
|
-
getState(deviceId: string): Promise<any>;
|
|
16
|
-
setState(deviceId: string, state: any): Promise<any>;
|
|
17
|
-
getStatus(deviceId: string): Promise<Record<string, any>>;
|
|
18
|
-
setStatus(deviceId: string, newStatus: IStatus): Promise<any>;
|
|
19
|
-
setStatusMany(query: IStatusQuery, newStatus: IStatus): Promise<any>;
|
|
20
|
-
getBatteryLevel(deviceId: string): Promise<Record<string, any>>;
|
|
21
|
-
setBatteryLevel(deviceId: string, newBatteryLevel: any): Promise<any>;
|
|
22
|
-
getMetaData(deviceId: string): Promise<any>;
|
|
23
|
-
setMetaData(deviceId: string, metaData: Record<string, any>): Promise<any>;
|
|
24
|
-
getDevicesByAccessGroup(accessGroupId: string): Promise<IDtDevice[]>;
|
|
25
|
-
getDevicesByZone(zoneId: string): Promise<IDtDevice[]>;
|
|
26
|
-
querySelect(query: any, fields: string[]): Promise<any>;
|
|
27
|
-
queryCount(query: any): Promise<number>;
|
|
28
|
-
deleteDevices(query: any): Promise<any>;
|
|
29
|
-
queryDevices(query: any): Promise<any>;
|
|
30
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IDevice } from "../interfaces";
|
|
2
|
-
export declare class HubRepository {
|
|
3
|
-
private readonly postgres;
|
|
4
|
-
private readonly axiosInstance;
|
|
5
|
-
constructor();
|
|
6
|
-
addHub(body: Partial<IDevice>): Promise<IDevice>;
|
|
7
|
-
getHubs(hubIds: string[]): Promise<IDevice[]>;
|
|
8
|
-
getHub(hubId: string): Promise<IDevice>;
|
|
9
|
-
updateHub(hubId: string, body: any): Promise<IDevice>;
|
|
10
|
-
getStatus(hubId: string): Promise<"ONLINE" | "OFFLINE" | "UNKNOWN">;
|
|
11
|
-
deleteHub(hubId: string): Promise<any>;
|
|
12
|
-
deleteAllHubs(hubIds: string[]): Promise<any>;
|
|
13
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { IIssueDocument } from "../models/Issue.model";
|
|
2
|
-
import { CreateIssueData, UpdateIssueData, IssueStatus, IssuePriority, IssuesCategory, EntityType } from "../../../types/issue.types";
|
|
3
|
-
export declare class IssueRepository {
|
|
4
|
-
/**
|
|
5
|
-
* Create a new issue
|
|
6
|
-
*/
|
|
7
|
-
create(issueData: CreateIssueData): Promise<IIssueDocument>;
|
|
8
|
-
/**
|
|
9
|
-
* Find issue by ID
|
|
10
|
-
*/
|
|
11
|
-
findById(id: string, includeDeleted?: boolean): Promise<IIssueDocument | null>;
|
|
12
|
-
/**
|
|
13
|
-
* Find all issues with filters
|
|
14
|
-
*/
|
|
15
|
-
findAll(filters?: {
|
|
16
|
-
propertyId?: string;
|
|
17
|
-
assignedTo?: string;
|
|
18
|
-
status?: IssueStatus;
|
|
19
|
-
priority?: IssuePriority;
|
|
20
|
-
category?: IssuesCategory;
|
|
21
|
-
entityType?: EntityType;
|
|
22
|
-
entityId?: string;
|
|
23
|
-
includeDeleted?: boolean;
|
|
24
|
-
limit?: number;
|
|
25
|
-
skip?: number;
|
|
26
|
-
sort?: {
|
|
27
|
-
[key: string]: 1 | -1;
|
|
28
|
-
};
|
|
29
|
-
}): Promise<IIssueDocument[]>;
|
|
30
|
-
/**
|
|
31
|
-
* Update an issue
|
|
32
|
-
*/
|
|
33
|
-
update(id: string, updateData: UpdateIssueData): Promise<IIssueDocument | null>;
|
|
34
|
-
/**
|
|
35
|
-
* Soft delete an issue
|
|
36
|
-
*/
|
|
37
|
-
softDelete(id: string, deletedBy: string): Promise<boolean>;
|
|
38
|
-
/**
|
|
39
|
-
* Permanently delete an issue
|
|
40
|
-
*/
|
|
41
|
-
hardDelete(id: string): Promise<boolean>;
|
|
42
|
-
/**
|
|
43
|
-
* Count issues with filters
|
|
44
|
-
*/
|
|
45
|
-
count(filters?: {
|
|
46
|
-
propertyId?: string;
|
|
47
|
-
assignedTo?: string;
|
|
48
|
-
status?: IssueStatus;
|
|
49
|
-
priority?: IssuePriority;
|
|
50
|
-
category?: IssuesCategory;
|
|
51
|
-
entityType?: EntityType;
|
|
52
|
-
entityId?: string;
|
|
53
|
-
includeDeleted?: boolean;
|
|
54
|
-
}): Promise<number>;
|
|
55
|
-
/**
|
|
56
|
-
* Find issues by property
|
|
57
|
-
*/
|
|
58
|
-
findByProperty(propertyId: string, includeDeleted?: boolean): Promise<IIssueDocument[]>;
|
|
59
|
-
/**
|
|
60
|
-
* Find issues by assignee
|
|
61
|
-
*/
|
|
62
|
-
findByAssignee(assignedTo: string, includeDeleted?: boolean): Promise<IIssueDocument[]>;
|
|
63
|
-
/**
|
|
64
|
-
* Find issues by entity
|
|
65
|
-
*/
|
|
66
|
-
findByEntity(entityId: string, entityType: EntityType, includeDeleted?: boolean): Promise<IIssueDocument[]>;
|
|
67
|
-
/**
|
|
68
|
-
* Find issues by status
|
|
69
|
-
*/
|
|
70
|
-
findByStatus(status: IssueStatus, includeDeleted?: boolean): Promise<IIssueDocument[]>;
|
|
71
|
-
/**
|
|
72
|
-
* Find issues by priority
|
|
73
|
-
*/
|
|
74
|
-
findByPriority(priority: IssuePriority, includeDeleted?: boolean): Promise<IIssueDocument[]>;
|
|
75
|
-
/**
|
|
76
|
-
* Find overdue issues
|
|
77
|
-
*/
|
|
78
|
-
findOverdue(includeDeleted?: boolean): Promise<IIssueDocument[]>;
|
|
79
|
-
/**
|
|
80
|
-
* Find upcoming issues
|
|
81
|
-
*/
|
|
82
|
-
findUpcoming(days?: number, includeDeleted?: boolean): Promise<IIssueDocument[]>;
|
|
83
|
-
/**
|
|
84
|
-
* Search issues by text
|
|
85
|
-
*/
|
|
86
|
-
search(searchTerm: string, filters?: {
|
|
87
|
-
propertyId?: string;
|
|
88
|
-
includeDeleted?: boolean;
|
|
89
|
-
limit?: number;
|
|
90
|
-
skip?: number;
|
|
91
|
-
}): Promise<IIssueDocument[]>;
|
|
92
|
-
/**
|
|
93
|
-
* Get issue statistics
|
|
94
|
-
*/
|
|
95
|
-
getStatistics(propertyId?: string): Promise<{
|
|
96
|
-
total: number;
|
|
97
|
-
pending: number;
|
|
98
|
-
inProgress: number;
|
|
99
|
-
resolved: number;
|
|
100
|
-
closed: number;
|
|
101
|
-
overdue: number;
|
|
102
|
-
byPriority: Record<IssuePriority, number>;
|
|
103
|
-
byCategory: Record<IssuesCategory, number>;
|
|
104
|
-
}>;
|
|
105
|
-
/**
|
|
106
|
-
* Bulk update issues
|
|
107
|
-
*/
|
|
108
|
-
bulkUpdate(ids: string[], updateData: Partial<UpdateIssueData>): Promise<number>;
|
|
109
|
-
/**
|
|
110
|
-
* Bulk soft delete issues
|
|
111
|
-
*/
|
|
112
|
-
bulkSoftDelete(ids: string[], deletedBy: string): Promise<number>;
|
|
113
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { IProperty, IPropertySettings } from "../interfaces/IProperty";
|
|
2
|
-
export declare class PropertyRepository {
|
|
3
|
-
private readonly postgres;
|
|
4
|
-
constructor();
|
|
5
|
-
getPropertyPreferences(propertyId: string): Promise<IPropertySettings | null>;
|
|
6
|
-
getProperty(propertyId: string): Promise<IProperty | null>;
|
|
7
|
-
getAllProperties(): Promise<any[]>;
|
|
8
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
-
var _, done = false;
|
|
8
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
-
var context = {};
|
|
10
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
-
if (kind === "accessor") {
|
|
15
|
-
if (result === void 0) continue;
|
|
16
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
-
}
|
|
21
|
-
else if (_ = accept(result)) {
|
|
22
|
-
if (kind === "field") initializers.unshift(_);
|
|
23
|
-
else descriptor[key] = _;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
-
done = true;
|
|
28
|
-
};
|
|
29
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
-
var useValue = arguments.length > 2;
|
|
31
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
-
}
|
|
34
|
-
return useValue ? value : void 0;
|
|
35
|
-
};
|
|
36
|
-
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
-
};
|
|
40
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.PropertyRepository = void 0;
|
|
42
|
-
const db_1 = require("../../../db");
|
|
43
|
-
const typedi_1 = require("typedi");
|
|
44
|
-
let PropertyRepository = (() => {
|
|
45
|
-
let _classDecorators = [(0, typedi_1.Service)()];
|
|
46
|
-
let _classDescriptor;
|
|
47
|
-
let _classExtraInitializers = [];
|
|
48
|
-
let _classThis;
|
|
49
|
-
var PropertyRepository = _classThis = class {
|
|
50
|
-
constructor() {
|
|
51
|
-
this.postgres = (0, db_1.getPostgresClient)();
|
|
52
|
-
}
|
|
53
|
-
async getPropertyPreferences(propertyId) {
|
|
54
|
-
try {
|
|
55
|
-
const propertyPreferences = await this.postgres.query(`SELECT * FROM dt_property_settings WHERE "propertyId" = $1`, [propertyId]);
|
|
56
|
-
if (propertyPreferences.rows.length > 0) {
|
|
57
|
-
return propertyPreferences.rows[0];
|
|
58
|
-
}
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
catch (error) {
|
|
62
|
-
console.log(error);
|
|
63
|
-
throw new Error("Failed to get property preferences");
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
async getProperty(propertyId) {
|
|
67
|
-
const property = await this.postgres.query("SELECT * FROM dt_properties WHERE id = $1", [propertyId]);
|
|
68
|
-
if (property.rows.length > 0) {
|
|
69
|
-
return property.rows[0];
|
|
70
|
-
}
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
async getAllProperties() {
|
|
74
|
-
try {
|
|
75
|
-
//Retrieve all the properties ids from the database
|
|
76
|
-
const properties = await this.postgres.query("SELECT id FROM dt_properties");
|
|
77
|
-
return properties.rows.map((property) => property.id);
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
console.log(error);
|
|
81
|
-
throw new Error("Failed to get all properties");
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
__setFunctionName(_classThis, "PropertyRepository");
|
|
86
|
-
(() => {
|
|
87
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
88
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
89
|
-
PropertyRepository = _classThis = _classDescriptor.value;
|
|
90
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
91
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
92
|
-
})();
|
|
93
|
-
return PropertyRepository = _classThis;
|
|
94
|
-
})();
|
|
95
|
-
exports.PropertyRepository = PropertyRepository;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ISchedule } from "../interfaces/ISchedule";
|
|
2
|
-
export declare class ScheduleRepository {
|
|
3
|
-
private readonly axiosInstance;
|
|
4
|
-
constructor();
|
|
5
|
-
getSchedule(scheduleId: string): Promise<any>;
|
|
6
|
-
getScheduleByZone(zoneId: string): Promise<any>;
|
|
7
|
-
setSchedule(scheduleId: string, schedule: ISchedule): Promise<any>;
|
|
8
|
-
deleteSchedule(scheduleId: string): Promise<any>;
|
|
9
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
-
var _, done = false;
|
|
8
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
-
var context = {};
|
|
10
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
-
if (kind === "accessor") {
|
|
15
|
-
if (result === void 0) continue;
|
|
16
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
-
}
|
|
21
|
-
else if (_ = accept(result)) {
|
|
22
|
-
if (kind === "field") initializers.unshift(_);
|
|
23
|
-
else descriptor[key] = _;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
-
done = true;
|
|
28
|
-
};
|
|
29
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
-
var useValue = arguments.length > 2;
|
|
31
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
-
}
|
|
34
|
-
return useValue ? value : void 0;
|
|
35
|
-
};
|
|
36
|
-
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
-
};
|
|
40
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.ScheduleRepository = void 0;
|
|
42
|
-
const typedi_1 = require("typedi");
|
|
43
|
-
const http_utils_1 = require("../../../utils/http.utils");
|
|
44
|
-
const config_1 = require("../../../config/config");
|
|
45
|
-
let ScheduleRepository = (() => {
|
|
46
|
-
let _classDecorators = [(0, typedi_1.Service)()];
|
|
47
|
-
let _classDescriptor;
|
|
48
|
-
let _classExtraInitializers = [];
|
|
49
|
-
let _classThis;
|
|
50
|
-
var ScheduleRepository = _classThis = class {
|
|
51
|
-
// private readonly logger = getLogger();
|
|
52
|
-
constructor() {
|
|
53
|
-
this.axiosInstance = (0, http_utils_1.getDeviceServiceAxiosInstance)();
|
|
54
|
-
}
|
|
55
|
-
async getSchedule(scheduleId) {
|
|
56
|
-
try {
|
|
57
|
-
const response = await this.axiosInstance.get(`/devices/schedule?id=${scheduleId}`);
|
|
58
|
-
return response.data;
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
(0, config_1.getConfig)().LOGGER.error(`Failed to get schedule ${scheduleId}:`, error);
|
|
62
|
-
const errorMessage = error.response?.data?.message || error.message || "Unknown error";
|
|
63
|
-
throw new Error(`Failed to get schedule: ${errorMessage}`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
async getScheduleByZone(zoneId) {
|
|
67
|
-
try {
|
|
68
|
-
const response = await this.axiosInstance.get(`/devices/schedules?zoneId=${zoneId}`);
|
|
69
|
-
return response.data;
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
(0, config_1.getConfig)().LOGGER.error(`Failed to get schedule by zone ${zoneId}:`, error);
|
|
73
|
-
const errorMessage = error.response?.data?.message || error.message || "Unknown error";
|
|
74
|
-
throw new Error(`Failed to get schedule: ${errorMessage}`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
async setSchedule(scheduleId, schedule) {
|
|
78
|
-
try {
|
|
79
|
-
const response = await this.axiosInstance.put(`/devices/schedules/${scheduleId}`, schedule);
|
|
80
|
-
return response.data;
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
83
|
-
(0, config_1.getConfig)().LOGGER.error(`Failed to update schedule ${scheduleId}:`, error);
|
|
84
|
-
const errorMessage = error.response?.data?.message || error.message || "Unknown error";
|
|
85
|
-
throw new Error(`Failed to update schedule: ${errorMessage}`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
async deleteSchedule(scheduleId) {
|
|
89
|
-
try {
|
|
90
|
-
const response = await this.axiosInstance.delete(`/devices/schedules/${scheduleId}`);
|
|
91
|
-
return response.data;
|
|
92
|
-
}
|
|
93
|
-
catch (error) {
|
|
94
|
-
(0, config_1.getConfig)().LOGGER.error(`Failed to delete schedule from DB ${scheduleId}:`, error);
|
|
95
|
-
throw new Error(`Failed to delete schedule from DB: ${error.message}`);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
__setFunctionName(_classThis, "ScheduleRepository");
|
|
100
|
-
(() => {
|
|
101
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
102
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
103
|
-
ScheduleRepository = _classThis = _classDescriptor.value;
|
|
104
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
105
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
106
|
-
})();
|
|
107
|
-
return ScheduleRepository = _classThis;
|
|
108
|
-
})();
|
|
109
|
-
exports.ScheduleRepository = ScheduleRepository;
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { AlertRepository } from "../repository/Alert.repository";
|
|
2
|
-
import { IAlertDocument } from "../models/Alert.model";
|
|
3
|
-
import { CreateAlertData, UpdateAlertData, AlertCategory, AlertSeverity, EntityType } from "../../../types/alert.types";
|
|
4
|
-
import { AlertBuilder } from "../entities/AlertBuilder";
|
|
5
|
-
export declare class AlertService {
|
|
6
|
-
private readonly alertRepository;
|
|
7
|
-
constructor(alertRepository: AlertRepository);
|
|
8
|
-
/**
|
|
9
|
-
* Create a readiness alert using AlertBuilder
|
|
10
|
-
*/
|
|
11
|
-
raiseReadinessAlert(propertyId: string, title: string, description: string, entityId?: string, entityType?: EntityType, createdBy?: string): Promise<IAlertDocument>;
|
|
12
|
-
/**
|
|
13
|
-
* Create an operations alert using AlertBuilder
|
|
14
|
-
*/
|
|
15
|
-
raiseOperationsAlert(propertyId: string, title: string, description: string, entityId?: string, entityType?: EntityType, createdBy?: string): Promise<IAlertDocument>;
|
|
16
|
-
/**
|
|
17
|
-
* Create a security alert using AlertBuilder
|
|
18
|
-
*/
|
|
19
|
-
raiseSecurityAlert(propertyId: string, title: string, description: string, entityId?: string, entityType?: EntityType, createdBy?: string): Promise<IAlertDocument>;
|
|
20
|
-
/**
|
|
21
|
-
* Create an energy alert using AlertBuilder
|
|
22
|
-
*/
|
|
23
|
-
raiseEnergyAlert(propertyId: string, title: string, description: string, entityId?: string, entityType?: EntityType, createdBy?: string): Promise<IAlertDocument>;
|
|
24
|
-
/**
|
|
25
|
-
* Create a device-specific alert using AlertBuilder
|
|
26
|
-
*/
|
|
27
|
-
raiseDeviceAlert(deviceId: string, propertyId: string, title: string, description: string, category?: AlertCategory, severity?: AlertSeverity, createdBy?: string): Promise<IAlertDocument>;
|
|
28
|
-
/**
|
|
29
|
-
* Create a hub-specific alert using AlertBuilder
|
|
30
|
-
*/
|
|
31
|
-
raiseHubAlert(hubId: string, propertyId: string, title: string, description: string, category?: AlertCategory, severity?: AlertSeverity, createdBy?: string): Promise<IAlertDocument>;
|
|
32
|
-
/**
|
|
33
|
-
* Create a new alert with business logic validation
|
|
34
|
-
* Accepts either a CreateAlertData object or an AlertBuilder instance
|
|
35
|
-
*/
|
|
36
|
-
createAlert(alertData: CreateAlertData | AlertBuilder): Promise<IAlertDocument>;
|
|
37
|
-
/**
|
|
38
|
-
* Get alert by ID with business logic
|
|
39
|
-
*/
|
|
40
|
-
getAlertById(id: string, includeDeleted?: boolean): Promise<IAlertDocument | null>;
|
|
41
|
-
/**
|
|
42
|
-
* Get all alerts with business logic filtering
|
|
43
|
-
*/
|
|
44
|
-
getAlerts(filters?: {
|
|
45
|
-
propertyId?: string;
|
|
46
|
-
category?: AlertCategory;
|
|
47
|
-
severity?: AlertSeverity;
|
|
48
|
-
entityType?: EntityType;
|
|
49
|
-
entityId?: string;
|
|
50
|
-
isActive?: boolean;
|
|
51
|
-
isRead?: boolean;
|
|
52
|
-
includeDeleted?: boolean;
|
|
53
|
-
limit?: number;
|
|
54
|
-
skip?: number;
|
|
55
|
-
}): Promise<IAlertDocument[]>;
|
|
56
|
-
/**
|
|
57
|
-
* Update an alert with business logic validation
|
|
58
|
-
*/
|
|
59
|
-
updateAlert(id: string, updateData: UpdateAlertData): Promise<IAlertDocument | null>;
|
|
60
|
-
/**
|
|
61
|
-
* Soft delete an alert with business logic
|
|
62
|
-
*/
|
|
63
|
-
deleteAlert(id: string, deletedBy: string): Promise<boolean>;
|
|
64
|
-
/**
|
|
65
|
-
* Mark alert as read with business logic
|
|
66
|
-
*/
|
|
67
|
-
markAsRead(id: string, updatedBy: string): Promise<IAlertDocument | null>;
|
|
68
|
-
/**
|
|
69
|
-
* Mark alert as unread with business logic
|
|
70
|
-
*/
|
|
71
|
-
markAsUnread(id: string, updatedBy: string): Promise<IAlertDocument | null>;
|
|
72
|
-
/**
|
|
73
|
-
* Activate an alert with business logic
|
|
74
|
-
*/
|
|
75
|
-
activateAlert(id: string, updatedBy: string): Promise<IAlertDocument | null>;
|
|
76
|
-
/**
|
|
77
|
-
* Deactivate an alert with business logic
|
|
78
|
-
*/
|
|
79
|
-
deactivateAlert(id: string, updatedBy: string): Promise<IAlertDocument | null>;
|
|
80
|
-
/**
|
|
81
|
-
* Snooze an alert with business logic
|
|
82
|
-
*/
|
|
83
|
-
snoozeAlert(id: string, until: Date, updatedBy: string): Promise<IAlertDocument | null>;
|
|
84
|
-
/**
|
|
85
|
-
* Unsnooze an alert with business logic
|
|
86
|
-
*/
|
|
87
|
-
unsnoozeAlert(id: string, updatedBy: string): Promise<IAlertDocument | null>;
|
|
88
|
-
/**
|
|
89
|
-
* Get alerts by property with business logic
|
|
90
|
-
*/
|
|
91
|
-
getAlertsByProperty(propertyId: string, includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
92
|
-
/**
|
|
93
|
-
* Get alerts by entity with business logic
|
|
94
|
-
*/
|
|
95
|
-
getAlertsByEntity(entityId: string, entityType: EntityType, includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
96
|
-
/**
|
|
97
|
-
* Get alerts by category with business logic
|
|
98
|
-
*/
|
|
99
|
-
getAlertsByCategory(category: AlertCategory, includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
100
|
-
/**
|
|
101
|
-
* Get alerts by severity with business logic
|
|
102
|
-
*/
|
|
103
|
-
getAlertsBySeverity(severity: AlertSeverity, includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
104
|
-
/**
|
|
105
|
-
* Get active alerts with business logic
|
|
106
|
-
*/
|
|
107
|
-
getActiveAlerts(includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
108
|
-
/**
|
|
109
|
-
* Get unread alerts with business logic
|
|
110
|
-
*/
|
|
111
|
-
getUnreadAlerts(includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
112
|
-
/**
|
|
113
|
-
* Get snoozed alerts with business logic
|
|
114
|
-
*/
|
|
115
|
-
getSnoozedAlerts(includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
116
|
-
/**
|
|
117
|
-
* Get expired snooze alerts with business logic
|
|
118
|
-
*/
|
|
119
|
-
getExpiredSnoozeAlerts(includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
120
|
-
/**
|
|
121
|
-
* Get alert statistics with business logic
|
|
122
|
-
*/
|
|
123
|
-
getAlertStatistics(propertyId?: string): Promise<{
|
|
124
|
-
total: number;
|
|
125
|
-
active: number;
|
|
126
|
-
unread: number;
|
|
127
|
-
snoozed: number;
|
|
128
|
-
bySeverity: Record<AlertSeverity, number>;
|
|
129
|
-
byCategory: Record<AlertCategory, number>;
|
|
130
|
-
}>;
|
|
131
|
-
private validateAlertData;
|
|
132
|
-
private validateFilters;
|
|
133
|
-
private validateUpdateData;
|
|
134
|
-
private validateSnoozeDate;
|
|
135
|
-
private determineDefaultSeverity;
|
|
136
|
-
private applyBusinessRules;
|
|
137
|
-
}
|