dt-common-device 13.0.27 → 13.1.1

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.
Files changed (168) hide show
  1. package/README.md +1 -1
  2. package/dist/issues/Issue.service.d.ts +1 -1
  3. package/dist/issues/Issue.service.js +8 -6
  4. package/dist/issues/issue.types.d.ts +7 -4
  5. package/dist/issues/issue.types.js +5 -2
  6. package/package.json +1 -1
  7. package/dist/admin/Admin.repository.d.ts +0 -7
  8. package/dist/admin/Admin.service.d.ts +0 -5
  9. package/dist/admin/index.d.ts +0 -1
  10. package/dist/alerts/AlertBuilder.example.d.ts +0 -11
  11. package/dist/alerts/AlertService.example.d.ts +0 -55
  12. package/dist/audit/AuditProperties.d.ts +0 -16
  13. package/dist/chronicle/Cronicle.service.d.ts +0 -9
  14. package/dist/chronicle/IChronicle.interface.d.ts +0 -14
  15. package/dist/chronicle/ICronicle.interface.d.ts +0 -15
  16. package/dist/chronicle/chronicle.service.d.ts +0 -4
  17. package/dist/chronicle/index.d.ts +0 -2
  18. package/dist/connection/Connection.repository.d.ts +0 -8
  19. package/dist/connection/Connection.service.d.ts +0 -8
  20. package/dist/connection/IConnection.d.ts +0 -28
  21. package/dist/connection/index.d.ts +0 -2
  22. package/dist/copilotQueue/examples/CopilotQueue.example.d.ts +0 -37
  23. package/dist/copilotQueue/examples/index.d.ts +0 -1
  24. package/dist/device/cloud/entities/CloudConnection.d.ts +0 -6
  25. package/dist/device/cloud/entities/CloudDevice.d.ts +0 -16
  26. package/dist/device/cloud/entities/CloudDeviceService.d.ts +0 -5
  27. package/dist/device/cloud/entities/DeviceFactory.d.ts +0 -7
  28. package/dist/device/cloud/entities/index.d.ts +0 -3
  29. package/dist/device/cloud/interface.d.ts +0 -101
  30. package/dist/device/cloud/interfaces/ICloudConnection.d.ts +0 -5
  31. package/dist/device/cloud/interfaces/ICloudDevice.d.ts +0 -9
  32. package/dist/device/cloud/interfaces/ICloudDeviceService.d.ts +0 -4
  33. package/dist/device/cloud/interfaces/IConnectionService.d.ts +0 -7
  34. package/dist/device/cloud/interfaces/IDeviceConnectionService.d.ts +0 -7
  35. package/dist/device/cloud/interfaces/IDeviceFactory.d.ts +0 -4
  36. package/dist/device/cloud/interfaces/IDeviceService.d.ts +0 -8
  37. package/dist/device/cloud/interfaces/IDevicesService.d.ts +0 -9
  38. package/dist/device/cloud/interfaces/IHubService.d.ts +0 -5
  39. package/dist/device/cloud/interfaces/IRawDataTransformer.d.ts +0 -4
  40. package/dist/device/cloud/interfaces/IRawDevice.d.ts +0 -17
  41. package/dist/device/cloud/interfaces/index.d.ts +0 -5
  42. package/dist/device/cloud/services/CloudDevice.service.d.ts +0 -5
  43. package/dist/device/cloud/services/Connection.service.d.ts +0 -8
  44. package/dist/device/cloud/services/Device.service.d.ts +0 -39
  45. package/dist/device/cloud/services/DeviceCloudService.d.ts +0 -42
  46. package/dist/device/cloud/services/DeviceHub.service.d.ts +0 -3
  47. package/dist/device/cloud/services/Hub.service.d.ts +0 -25
  48. package/dist/device/cloud/services/SmartThingsDeviceService.d.ts +0 -38
  49. package/dist/device/cloud/services/SmartThingsDeviceService.js +0 -52
  50. package/dist/device/cloud/services/index.d.ts +0 -2
  51. package/dist/device/cloud/types.d.ts +0 -52
  52. package/dist/device/cloud/types.js +0 -15
  53. package/dist/device/index.d.ts +0 -4
  54. package/dist/device/local/entities/AlertBuilder.d.ts +0 -87
  55. package/dist/device/local/entities/AlertBuilder.example.d.ts +0 -11
  56. package/dist/device/local/entities/IssueBuilder.d.ts +0 -109
  57. package/dist/device/local/entities/IssueBuilder.example.d.ts +0 -16
  58. package/dist/device/local/entities/IssueBuilder.example.js +0 -196
  59. package/dist/device/local/entities/IssueBuilder.js +0 -237
  60. package/dist/device/local/entities/index.d.ts +0 -2
  61. package/dist/device/local/events/EventHandler.d.ts +0 -11
  62. package/dist/device/local/events/Events.d.ts +0 -54
  63. package/dist/device/local/events/index.d.ts +0 -2
  64. package/dist/device/local/handler/EventHandler.d.ts +0 -7
  65. package/dist/device/local/interface.d.ts +0 -0
  66. package/dist/device/local/interfaces/IConnection.d.ts +0 -26
  67. package/dist/device/local/interfaces/IDevice.d.ts +0 -68
  68. package/dist/device/local/interfaces/IDtDevice.d.ts +0 -16
  69. package/dist/device/local/interfaces/IHub.d.ts +0 -46
  70. package/dist/device/local/interfaces/IProperty.d.ts +0 -29
  71. package/dist/device/local/interfaces/ISchedule.d.ts +0 -25
  72. package/dist/device/local/interfaces/index.d.ts +0 -3
  73. package/dist/device/local/models/Alert.model.d.ts +0 -28
  74. package/dist/device/local/models/Issue.model.d.ts +0 -28
  75. package/dist/device/local/repository/Alert.repository.d.ts +0 -106
  76. package/dist/device/local/repository/Connection.repository.d.ts +0 -8
  77. package/dist/device/local/repository/Device.repository.d.ts +0 -30
  78. package/dist/device/local/repository/Hub.repository.d.ts +0 -13
  79. package/dist/device/local/repository/Issue.repository.d.ts +0 -113
  80. package/dist/device/local/repository/Property.repository.d.ts +0 -8
  81. package/dist/device/local/repository/Property.repository.js +0 -95
  82. package/dist/device/local/repository/Schedule.repository.d.ts +0 -9
  83. package/dist/device/local/repository/Schedule.repository.js +0 -109
  84. package/dist/device/local/services/Alert.service.d.ts +0 -137
  85. package/dist/device/local/services/AlertService.example.d.ts +0 -55
  86. package/dist/device/local/services/Connection.service.d.ts +0 -8
  87. package/dist/device/local/services/Device.service.d.ts +0 -40
  88. package/dist/device/local/services/DeviceHub.service.d.ts +0 -11
  89. package/dist/device/local/services/Hub.service.d.ts +0 -12
  90. package/dist/device/local/services/Issue.service.d.ts +0 -168
  91. package/dist/device/local/services/Issue.service.js +0 -642
  92. package/dist/device/local/services/IssueService.example.d.ts +0 -68
  93. package/dist/device/local/services/IssueService.example.js +0 -177
  94. package/dist/device/local/services/Property.service.d.ts +0 -8
  95. package/dist/device/local/services/Property.service.js +0 -36
  96. package/dist/device/local/services/Schedule.service.d.ts +0 -9
  97. package/dist/device/local/services/Schedule.service.js +0 -26
  98. package/dist/device/local/services/index.d.ts +0 -3
  99. package/dist/entities/accessGroup/AccessGroup.repository.d.ts +0 -5
  100. package/dist/entities/accessGroup/AccessGroup.service.d.ts +0 -5
  101. package/dist/entities/accessGroup/IAccessGroup.d.ts +0 -14
  102. package/dist/entities/accessGroup/index.d.ts +0 -2
  103. package/dist/entities/device/local/repository/DeviceProfile.repository.d.ts +0 -5
  104. package/dist/entities/guest/Guest.repository.d.ts +0 -6
  105. package/dist/entities/guest/Guest.service.d.ts +0 -6
  106. package/dist/entities/guest/IGuest.d.ts +0 -12
  107. package/dist/entities/guest/index.d.ts +0 -2
  108. package/dist/entities/schedules/ISchedule.d.ts +0 -14
  109. package/dist/entities/schedules/Schedule.repository.d.ts +0 -6
  110. package/dist/entities/schedules/Schedule.repository.js +0 -74
  111. package/dist/entities/schedules/Schedule.service.d.ts +0 -6
  112. package/dist/entities/schedules/Schedule.service.js +0 -104
  113. package/dist/entities/schedules/index.d.ts +0 -2
  114. package/dist/entities/user/IUser.d.ts +0 -15
  115. package/dist/entities/user/IUser.js +0 -2
  116. package/dist/entities/user/User.repository.d.ts +0 -5
  117. package/dist/entities/user/User.repository.js +0 -68
  118. package/dist/entities/user/User.service.d.ts +0 -6
  119. package/dist/entities/user/User.service.js +0 -103
  120. package/dist/entities/zone/IZone.d.ts +0 -10
  121. package/dist/entities/zone/IZone.js +0 -2
  122. package/dist/entities/zone/Zone.repository.d.ts +0 -6
  123. package/dist/entities/zone/Zone.repository.js +0 -77
  124. package/dist/entities/zone/Zone.service.d.ts +0 -6
  125. package/dist/entities/zone/Zone.service.js +0 -104
  126. package/dist/entities/zone/index.d.ts +0 -2
  127. package/dist/issues/IssueBuilder.example.d.ts +0 -16
  128. package/dist/issues/IssueBuilder.example.js +0 -196
  129. package/dist/issues/IssueService.example.d.ts +0 -68
  130. package/dist/issues/IssueService.example.js +0 -292
  131. package/dist/pms/IPms.d.ts +0 -6
  132. package/dist/pms/index.d.ts +0 -1
  133. package/dist/pms/webhookQueue/examples/index.d.ts +0 -2
  134. package/dist/pms/webhookQueue/examples/pms-integration.d.ts +0 -65
  135. package/dist/pms/webhookQueue/examples/pms-integration.js +0 -254
  136. package/dist/pms/webhookQueue/examples/usage.d.ts +0 -7
  137. package/dist/pms/webhookQueue/examples/usage.js +0 -175
  138. package/dist/pms/webhookQueue/index.d.ts +0 -3
  139. package/dist/pms/webhookQueue/interfaces/IWebhookQueue.d.ts +0 -33
  140. package/dist/pms/webhookQueue/interfaces/IWebhookQueue.js +0 -2
  141. package/dist/pms/webhookQueue/interfaces/IWebhookWorker.d.ts +0 -38
  142. package/dist/pms/webhookQueue/interfaces/IWebhookWorker.js +0 -2
  143. package/dist/pms/webhookQueue/interfaces/index.d.ts +0 -1
  144. package/dist/pms/webhookQueue/services/WebhookQueueFactory.d.ts +0 -38
  145. package/dist/pms/webhookQueue/services/WebhookQueueFactory.js +0 -131
  146. package/dist/pms/webhookQueue/services/WebhookQueueIntegration.d.ts +0 -70
  147. package/dist/pms/webhookQueue/services/WebhookQueueIntegration.js +0 -207
  148. package/dist/pms/webhookQueue/services/WebhookQueueService.d.ts +0 -45
  149. package/dist/pms/webhookQueue/services/WebhookQueueService.js +0 -270
  150. package/dist/pms/webhookQueue/services/WebhookWorker.d.ts +0 -37
  151. package/dist/pms/webhookQueue/services/WebhookWorker.js +0 -201
  152. package/dist/pms/webhookQueue/services/index.d.ts +0 -1
  153. package/dist/pms/webhookQueue/types/index.d.ts +0 -1
  154. package/dist/pms/webhookQueue/types/webhook.types.d.ts +0 -39
  155. package/dist/pms/webhookQueue/types/webhook.types.js +0 -2
  156. package/dist/property/IProperty.d.ts +0 -29
  157. package/dist/property/Property.repository.d.ts +0 -8
  158. package/dist/property/Property.repository.js +0 -109
  159. package/dist/property/Property.service.d.ts +0 -8
  160. package/dist/property/Property.service.js +0 -124
  161. package/dist/property/index.d.ts +0 -2
  162. package/dist/queue/interfaces/IHttpRequestJob.d.ts +0 -9
  163. package/dist/types/alert.types.d.ts +0 -57
  164. package/dist/types/config.types.d.ts +0 -19
  165. package/dist/types/index.d.ts +0 -3
  166. package/dist/types/issue.types.d.ts +0 -90
  167. package/dist/types/issue.types.js +0 -40
  168. package/dist/utils/http-utils.d.ts +0 -13
@@ -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
- }
@@ -1,55 +0,0 @@
1
- import { AlertService } from "./Alert.service";
2
- /**
3
- * Example usage of the updated AlertService with AlertBuilder integration
4
- * This file demonstrates various ways to use the AlertService with the new AlertBuilder
5
- */
6
- export declare class AlertServiceExample {
7
- private readonly alertService;
8
- constructor(alertService: AlertService);
9
- /**
10
- * Example 1: Using the updated createAlert method with AlertBuilder
11
- */
12
- createAlertWithBuilder(): Promise<import("../../../types/alert.types").AlertDocument>;
13
- /**
14
- * Example 2: Using convenience methods for specific alert types
15
- */
16
- createSpecificAlerts(): Promise<{
17
- readinessAlert: import("../../../types/alert.types").AlertDocument;
18
- operationsAlert: import("../../../types/alert.types").AlertDocument;
19
- securityAlert: import("../../../types/alert.types").AlertDocument;
20
- energyAlert: import("../../../types/alert.types").AlertDocument;
21
- }>;
22
- /**
23
- * Example 3: Using device-specific alert methods
24
- */
25
- createDeviceAlerts(): Promise<{
26
- deviceAlert1: import("../../../types/alert.types").AlertDocument;
27
- deviceAlert2: import("../../../types/alert.types").AlertDocument;
28
- }>;
29
- /**
30
- * Example 4: Using hub-specific alert methods
31
- */
32
- createHubAlerts(): Promise<{
33
- hubAlert1: import("../../../types/alert.types").AlertDocument;
34
- hubAlert2: import("../../../types/alert.types").AlertDocument;
35
- }>;
36
- /**
37
- * Example 5: Using static factory methods with AlertBuilder
38
- */
39
- createAlertsWithStaticMethods(): Promise<{
40
- alert1: import("../../../types/alert.types").AlertDocument;
41
- alert2: import("../../../types/alert.types").AlertDocument;
42
- }>;
43
- /**
44
- * Example 6: Creating multiple alerts efficiently
45
- */
46
- createMultipleAlerts(): Promise<import("../../../types/alert.types").AlertDocument[]>;
47
- /**
48
- * Example 7: Creating alerts with snooze functionality
49
- */
50
- createSnoozedAlert(): Promise<import("../../../types/alert.types").AlertDocument>;
51
- /**
52
- * Example 8: Backward compatibility - still works with CreateAlertData
53
- */
54
- createAlertWithLegacyData(): Promise<import("../../../types/alert.types").AlertDocument>;
55
- }
@@ -1,8 +0,0 @@
1
- import { IConnection } from "../interfaces/IConnection";
2
- export declare class LocalConnectionService {
3
- private readonly connectionRepository;
4
- constructor();
5
- createConnection(data: Partial<IConnection>): Promise<IConnection>;
6
- getConnection(connectionId: string): Promise<IConnection>;
7
- updateConnection(connectionId: string, data: Partial<IConnection>): Promise<IConnection>;
8
- }
@@ -1,40 +0,0 @@
1
- import { IDevice, IStatus, IStatusQuery } from "../interfaces";
2
- import { Source } from "../../../constants/Service";
3
- import { AuditProperties } from "../../../audit/AuditProperties";
4
- export declare class LocalDeviceService {
5
- private readonly eventHandler;
6
- private readonly deviceRepository;
7
- private readonly alertService;
8
- private readonly issueService;
9
- private readonly logger;
10
- constructor();
11
- createDevice(body: IDevice): Promise<IDevice>;
12
- getDevice(deviceId: string, withHubDetails?: boolean): Promise<IDevice>;
13
- getDevices(deviceIds: string[], withHubDetails?: boolean): Promise<IDevice[]>;
14
- getPropertyDevices(propertyId: string, selectDeviceId?: boolean, type?: string, withHubDetails?: boolean): Promise<IDevice[]>;
15
- getPropertyDeviceIds(propertyId: string, selectDeviceId: boolean | undefined, type: string): Promise<any>;
16
- updateDevice(deviceId: string, body: any, auditBody: AuditProperties): Promise<any>;
17
- updateDevices(query: any, updateData: any): Promise<any>;
18
- deleteDevice(deviceId: string, auditBody: AuditProperties): Promise<any>;
19
- getState(deviceId: string): Promise<any>;
20
- setState(deviceId: string, newState: any, auditProperties: AuditProperties): Promise<void>;
21
- getStatus(deviceId: string): Promise<Record<string, any>>;
22
- setStatus(deviceId: string, newStatus: IStatus, source: Source, auditBody: AuditProperties, reason?: string): Promise<void>;
23
- setStatusMany(query: IStatusQuery, newStatus: IStatus, source: Source, auditBody: AuditProperties): Promise<void>;
24
- private handleOfflineStatus;
25
- private handleOnlineStatus;
26
- private getDeviceBaseline;
27
- getBatteryLevel(deviceId: string): Promise<Record<string, any>>;
28
- setBatteryLevel(deviceId: string, batteryLevel: number, source: Source, auditBody: AuditProperties): Promise<void>;
29
- private shouldUpdateBatteryLevel;
30
- private getPropertyBatteryThreshold;
31
- private checkForDeviceMalfunctions;
32
- getMetaData(deviceId: string): Promise<any>;
33
- setMetaData(deviceId: string, metaData: Record<string, any>, auditBody: AuditProperties): Promise<any>;
34
- getDevicesByZone(zoneId: string): Promise<import("../interfaces").IDtDevice[]>;
35
- getDevicesByAccessGroup(accessGroupId: string): Promise<import("../interfaces").IDtDevice[]>;
36
- querySelect(query: any, fields: string[]): Promise<any>;
37
- queryCount(query: any): Promise<number>;
38
- deleteDevices(query: any): Promise<any>;
39
- queryDevices(query: any): Promise<any>;
40
- }
@@ -1,11 +0,0 @@
1
- import { IHubCreateParams } from "../interfaces";
2
- export declare class DeviceHubService {
3
- private readonly baseUrl;
4
- constructor();
5
- addHub(body: IHubCreateParams): Promise<any>;
6
- getHubs(hubIds: string[]): Promise<any>;
7
- getHub(hubId: string): Promise<any>;
8
- updateHub(hubId: string, body: any): Promise<any>;
9
- deleteHub(hubId: string): Promise<any>;
10
- deleteAllHubs(hubIds: string[]): Promise<any>;
11
- }
@@ -1,12 +0,0 @@
1
- import { IDevice } from "../interfaces";
2
- export declare class LocalHubService {
3
- private readonly hubRepository;
4
- constructor();
5
- addHub(body: Partial<IDevice>): Promise<IDevice>;
6
- getHubs(hubIds: string[]): Promise<IDevice[]>;
7
- getHub(hubId: string): Promise<IDevice>;
8
- updateHub(hubId: string, body: Partial<IDevice>): Promise<IDevice>;
9
- getStatus(hubId: string): Promise<any>;
10
- deleteHub(hubId: string): Promise<any>;
11
- deleteAllHubs(hubIds: string[]): Promise<any>;
12
- }
@@ -1,168 +0,0 @@
1
- import { IssueRepository } from "../repository/Issue.repository";
2
- import { IIssueDocument } from "../models/Issue.model";
3
- import { CreateIssueData, UpdateIssueData, AddCommentData, IssueStatus, IssuePriority, IssuesCategory, EntityType } from "../../../types/issue.types";
4
- import { IssueBuilder } from "../entities/IssueBuilder";
5
- export declare class IssueService {
6
- private readonly issueRepository;
7
- constructor(issueRepository: IssueRepository);
8
- /**
9
- * Create a readiness issue using IssueBuilder
10
- */
11
- createReadinessIssue(propertyId: string, title: string, description: string, createdBy: string, entityId?: string, entityType?: EntityType, assignedTo?: string, dueDate?: Date): Promise<IIssueDocument>;
12
- /**
13
- * Create an operations issue using IssueBuilder
14
- */
15
- createOperationsIssue(propertyId: string, title: string, description: string, createdBy: string, entityId?: string, entityType?: EntityType, assignedTo?: string, dueDate?: Date): Promise<IIssueDocument>;
16
- /**
17
- * Create a security issue using IssueBuilder
18
- */
19
- createSecurityIssue(propertyId: string, title: string, description: string, createdBy: string, entityId?: string, entityType?: EntityType, assignedTo?: string, dueDate?: Date): Promise<IIssueDocument>;
20
- /**
21
- * Create an energy issue using IssueBuilder
22
- */
23
- createEnergyIssue(propertyId: string, title: string, description: string, createdBy: string, entityId?: string, entityType?: EntityType, assignedTo?: string, dueDate?: Date): Promise<IIssueDocument>;
24
- /**
25
- * Create a device-specific issue using IssueBuilder
26
- */
27
- createDeviceIssue(deviceId: string, propertyId: string, title: string, description: string, createdBy: string, category?: IssuesCategory, priority?: IssuePriority, assignedTo?: string, dueDate?: Date): Promise<IIssueDocument>;
28
- /**
29
- * Create a hub-specific issue using IssueBuilder
30
- */
31
- createHubIssue(hubId: string, propertyId: string, title: string, description: string, createdBy: string, category?: IssuesCategory, priority?: IssuePriority, assignedTo?: string, dueDate?: Date): Promise<IIssueDocument>;
32
- /**
33
- * Create a user-specific issue using IssueBuilder
34
- */
35
- createUserIssue(userId: string, propertyId: string, title: string, description: string, createdBy: string, category?: IssuesCategory, priority?: IssuePriority, assignedTo?: string, dueDate?: Date): Promise<IIssueDocument>;
36
- /**
37
- * Create a maintenance issue using IssueBuilder
38
- */
39
- createMaintenanceIssue(propertyId: string, title: string, description: string, createdBy: string, entityId?: string, entityType?: EntityType, assignedTo?: string, dueDate?: Date): Promise<IIssueDocument>;
40
- /**
41
- * Create an urgent issue using IssueBuilder
42
- */
43
- createUrgentIssue(propertyId: string, title: string, description: string, createdBy: string, entityId?: string, entityType?: EntityType, assignedTo?: string, dueDate?: Date): Promise<IIssueDocument>;
44
- /**
45
- * Create a new issue with business logic validation
46
- * Accepts either a CreateIssueData object or an IssueBuilder instance
47
- */
48
- createIssue(issueData: CreateIssueData | IssueBuilder): Promise<IIssueDocument>;
49
- /**
50
- * Get issue by ID with business logic
51
- */
52
- getIssueById(id: string, includeDeleted?: boolean): Promise<IIssueDocument | null>;
53
- /**
54
- * Get all issues with business logic filtering
55
- */
56
- getIssues(filters?: {
57
- propertyId?: string;
58
- assignedTo?: string;
59
- status?: IssueStatus;
60
- priority?: IssuePriority;
61
- category?: IssuesCategory;
62
- entityType?: EntityType;
63
- entityId?: string;
64
- includeDeleted?: boolean;
65
- limit?: number;
66
- skip?: number;
67
- }): Promise<IIssueDocument[]>;
68
- /**
69
- * Update an issue with business logic validation
70
- */
71
- updateIssue(id: string, updateData: UpdateIssueData): Promise<IIssueDocument | null>;
72
- /**
73
- * Soft delete an issue with business logic
74
- */
75
- deleteIssue(id: string, deletedBy: string): Promise<boolean>;
76
- /**
77
- * Permanently delete an issue
78
- */
79
- permanentlyDeleteIssue(id: string): Promise<boolean>;
80
- /**
81
- * Add a comment with business logic
82
- */
83
- addComment(issueId: string, commentData: AddCommentData): Promise<IIssueDocument | null>;
84
- /**
85
- * Update a comment on an issue
86
- */
87
- updateComment(issueId: string, commentId: string, content: string, userId: string): Promise<boolean>;
88
- /**
89
- * Remove a comment from an issue
90
- */
91
- removeComment(issueId: string, commentId: string): Promise<boolean>;
92
- /**
93
- * Resolve an issue with business logic
94
- */
95
- resolveIssue(id: string, resolvedBy: string): Promise<IIssueDocument | null>;
96
- /**
97
- * Reopen a resolved issue
98
- */
99
- reopenIssue(id: string, reopenedBy: string): Promise<IIssueDocument | null>;
100
- /**
101
- * Assign an issue with business logic
102
- */
103
- assignIssue(id: string, userId: string, assignedBy: string): Promise<IIssueDocument | null>;
104
- /**
105
- * Unassign an issue
106
- */
107
- unassignIssue(id: string, unassignedBy: string): Promise<IIssueDocument | null>;
108
- /**
109
- * Get issues by property with business logic
110
- */
111
- getIssuesByProperty(propertyId: string, includeDeleted?: boolean): Promise<IIssueDocument[]>;
112
- /**
113
- * Get issues assigned to a user with business logic
114
- */
115
- getIssuesByAssignee(assignedTo: string, includeDeleted?: boolean): Promise<IIssueDocument[]>;
116
- /**
117
- * Get issues by entity
118
- */
119
- getIssuesByEntity(entityId: string, entityType: EntityType, includeDeleted?: boolean): Promise<IIssueDocument[]>;
120
- /**
121
- * Get issues by status
122
- */
123
- getIssuesByStatus(status: IssueStatus, includeDeleted?: boolean): Promise<IIssueDocument[]>;
124
- /**
125
- * Get issues by priority
126
- */
127
- getIssuesByPriority(priority: IssuePriority, includeDeleted?: boolean): Promise<IIssueDocument[]>;
128
- /**
129
- * Get overdue issues with business logic
130
- */
131
- getOverdueIssues(includeDeleted?: boolean): Promise<IIssueDocument[]>;
132
- /**
133
- * Get upcoming issues (due within specified days)
134
- */
135
- getUpcomingIssues(days?: number, includeDeleted?: boolean): Promise<IIssueDocument[]>;
136
- /**
137
- * Get issue statistics with business logic
138
- */
139
- getIssueStatistics(propertyId?: string): Promise<{
140
- total: number;
141
- pending: number;
142
- inProgress: number;
143
- resolved: number;
144
- closed: number;
145
- overdue: number;
146
- byPriority: Record<IssuePriority, number>;
147
- byCategory: Record<IssuesCategory, number>;
148
- }>;
149
- /**
150
- * Search issues with business logic
151
- */
152
- searchIssues(searchTerm: string, filters?: {
153
- propertyId?: string;
154
- includeDeleted?: boolean;
155
- limit?: number;
156
- skip?: number;
157
- }): Promise<IIssueDocument[]>;
158
- private validateIssueData;
159
- private validateFilters;
160
- private validateUpdateData;
161
- private validateStatusTransition;
162
- private validatePriorityChange;
163
- private determineDefaultPriority;
164
- private applyBusinessRules;
165
- private shouldUpdateStatusOnComment;
166
- private calculateAverageResponseTime;
167
- private calculateResolutionRate;
168
- }