dt-common-device 7.1.0 → 7.1.2
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/config/constants.js +1 -1
- package/dist/entities/device/local/interfaces/ISchedule.d.ts +6 -5
- package/dist/entities/device/local/repository/Schedule.repository.d.ts +1 -0
- package/dist/entities/device/local/repository/Schedule.repository.js +12 -0
- package/dist/entities/device/local/services/Schedule.service.d.ts +1 -0
- package/dist/entities/device/local/services/Schedule.service.js +3 -0
- package/dist/issues/Issue.model.js +6 -1
- package/dist/issues/Issue.service.d.ts +9 -1
- package/dist/issues/Issue.service.js +15 -3
- package/dist/issues/IssueBuilder.d.ts +9 -8
- package/dist/issues/IssueBuilder.js +38 -21
- package/dist/issues/issue.types.d.ts +29 -4
- package/dist/issues/issue.types.js +23 -1
- package/package.json +1 -1
package/dist/config/constants.js
CHANGED
|
@@ -2,8 +2,9 @@ export interface ISchedule {
|
|
|
2
2
|
id?: string;
|
|
3
3
|
name: string;
|
|
4
4
|
deviceId: string;
|
|
5
|
-
scheduleId: string
|
|
5
|
+
scheduleId: string;
|
|
6
6
|
state: {
|
|
7
|
+
on?: boolean;
|
|
7
8
|
targetTemperature?: number;
|
|
8
9
|
temperatureUnit?: "C" | "F";
|
|
9
10
|
mode?: "cool" | "heat" | "fan" | "dry" | "auto";
|
|
@@ -12,14 +13,14 @@ export interface ISchedule {
|
|
|
12
13
|
};
|
|
13
14
|
startTime: string;
|
|
14
15
|
endTime: string;
|
|
15
|
-
|
|
16
|
+
recurOnDaysOfWeek?: ("Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday")[];
|
|
16
17
|
createTime?: string;
|
|
17
18
|
nextTime?: string;
|
|
18
19
|
nextTimeSecondsFromNow?: number;
|
|
19
20
|
targetTimeLocal: string;
|
|
20
21
|
timezone: string;
|
|
21
|
-
scheduleInheritedFrom
|
|
22
|
+
scheduleInheritedFrom?: "zone" | "device";
|
|
22
23
|
zoneId: string;
|
|
23
|
-
userId
|
|
24
|
-
status
|
|
24
|
+
userId?: string;
|
|
25
|
+
status: "SET" | "UNSET";
|
|
25
26
|
}
|
|
@@ -2,6 +2,7 @@ import { ISchedule } from "../interfaces/ISchedule";
|
|
|
2
2
|
export declare class ScheduleRepository {
|
|
3
3
|
private readonly axiosInstance;
|
|
4
4
|
constructor();
|
|
5
|
+
createSchedule(schedule: ISchedule): Promise<any>;
|
|
5
6
|
getSchedule(scheduleId: string): Promise<any>;
|
|
6
7
|
getScheduleByZone(zoneId: string): Promise<any>;
|
|
7
8
|
setSchedule(scheduleId: string, schedule: ISchedule): Promise<any>;
|
|
@@ -52,6 +52,18 @@ let ScheduleRepository = (() => {
|
|
|
52
52
|
constructor() {
|
|
53
53
|
this.axiosInstance = (0, http_utils_1.getDeviceServiceAxiosInstance)();
|
|
54
54
|
}
|
|
55
|
+
async createSchedule(schedule) {
|
|
56
|
+
try {
|
|
57
|
+
const response = await this.axiosInstance.post(`/devices/schedules`, {
|
|
58
|
+
schedules: [schedule],
|
|
59
|
+
});
|
|
60
|
+
return response.data;
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
(0, config_1.getConfig)().LOGGER.error(`Failed to create schedule: ${error.message}`);
|
|
64
|
+
throw new Error(`Failed to create schedule: ${JSON.stringify(error)}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
55
67
|
async getSchedule(scheduleId) {
|
|
56
68
|
try {
|
|
57
69
|
const response = await this.axiosInstance.get(`/devices/schedule?id=${scheduleId}`);
|
|
@@ -2,6 +2,7 @@ import { ISchedule } from "../interfaces/ISchedule";
|
|
|
2
2
|
export declare class LocalScheduleService {
|
|
3
3
|
private readonly scheduleRepository;
|
|
4
4
|
constructor();
|
|
5
|
+
createSchedule(schedule: ISchedule): Promise<any>;
|
|
5
6
|
getSchedule(scheduleId: string): Promise<any>;
|
|
6
7
|
setSchedule(scheduleId: string, schedule: ISchedule): Promise<any>;
|
|
7
8
|
getScheduleByZone(zoneId: string): Promise<any>;
|
|
@@ -10,6 +10,9 @@ class LocalScheduleService {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
this.scheduleRepository = typedi_1.default.get(Schedule_repository_1.ScheduleRepository);
|
|
12
12
|
}
|
|
13
|
+
async createSchedule(schedule) {
|
|
14
|
+
return await this.scheduleRepository.createSchedule(schedule);
|
|
15
|
+
}
|
|
13
16
|
async getSchedule(scheduleId) {
|
|
14
17
|
return await this.scheduleRepository.getSchedule(scheduleId);
|
|
15
18
|
}
|
|
@@ -58,7 +58,7 @@ const IssueSchema = new mongoose_1.Schema({
|
|
|
58
58
|
},
|
|
59
59
|
zoneId: {
|
|
60
60
|
type: String,
|
|
61
|
-
required:
|
|
61
|
+
required: false,
|
|
62
62
|
index: true,
|
|
63
63
|
},
|
|
64
64
|
title: {
|
|
@@ -87,6 +87,11 @@ const IssueSchema = new mongoose_1.Schema({
|
|
|
87
87
|
default: issue_types_1.IssueStatus.PENDING,
|
|
88
88
|
index: true,
|
|
89
89
|
},
|
|
90
|
+
type: {
|
|
91
|
+
type: String,
|
|
92
|
+
enum: Object.values(issue_types_1.IssueType),
|
|
93
|
+
required: true,
|
|
94
|
+
},
|
|
90
95
|
priority: {
|
|
91
96
|
type: String,
|
|
92
97
|
enum: Object.values(issue_types_1.IssuePriority),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IIssueDocument } from "./Issue.model";
|
|
2
|
-
import { CreateIssueData, UpdateIssueData, AddCommentData, IssuePriority, IssuesCategory, IIssueQuery } from "./issue.types";
|
|
2
|
+
import { CreateIssueData, UpdateIssueData, AddCommentData, IssuePriority, IssuesCategory, EntityType, IIssueQuery } from "./issue.types";
|
|
3
3
|
import { IssueBuilder } from "./IssueBuilder";
|
|
4
4
|
import { Source } from "../constants/Service";
|
|
5
5
|
import { IDevice } from "../entities/device/local/interfaces";
|
|
@@ -34,6 +34,14 @@ export declare class IssueService {
|
|
|
34
34
|
* Create a user-specific issue using IssueBuilder
|
|
35
35
|
*/
|
|
36
36
|
createUserIssue(data: CreateIssueData): Promise<IIssueDocument>;
|
|
37
|
+
createCloudAccountAuthorizationIssue(data: {
|
|
38
|
+
propertyId: string;
|
|
39
|
+
entityId: string;
|
|
40
|
+
entityType: EntityType;
|
|
41
|
+
title: string;
|
|
42
|
+
description: string;
|
|
43
|
+
createdBy: string;
|
|
44
|
+
}): Promise<IIssueDocument>;
|
|
37
45
|
/**
|
|
38
46
|
* Create issue for device going offline longer than baseline
|
|
39
47
|
*/
|
|
@@ -221,6 +221,13 @@ let IssueService = (() => {
|
|
|
221
221
|
issueBuilder.setDueDate(data.dueDate);
|
|
222
222
|
return await this.createIssue(issueBuilder);
|
|
223
223
|
}
|
|
224
|
+
async createCloudAccountAuthorizationIssue(data) {
|
|
225
|
+
const issueBuilder = IssueBuilder_1.IssueBuilder.createCloudAccountAuthorizationIssue(data.propertyId, data.entityId, data.entityType)
|
|
226
|
+
.setTitle(data.title)
|
|
227
|
+
.setDescription(data.description)
|
|
228
|
+
.setCreatedBy(data.createdBy);
|
|
229
|
+
return await this.createIssue(issueBuilder);
|
|
230
|
+
}
|
|
224
231
|
/**
|
|
225
232
|
* Create issue for device going offline longer than baseline
|
|
226
233
|
*/
|
|
@@ -235,6 +242,7 @@ let IssueService = (() => {
|
|
|
235
242
|
createdBy: source,
|
|
236
243
|
category: issue_types_1.IssuesCategory.OPERATIONS,
|
|
237
244
|
priority: issue_types_1.IssuePriority.HIGH,
|
|
245
|
+
type: issue_types_1.IssueType.DEVICE_OFFLINE,
|
|
238
246
|
});
|
|
239
247
|
}
|
|
240
248
|
async createDoorLeftOpenIssue(device, source, reason) {
|
|
@@ -249,6 +257,7 @@ let IssueService = (() => {
|
|
|
249
257
|
createdBy: source,
|
|
250
258
|
category: issue_types_1.IssuesCategory.SECURITY,
|
|
251
259
|
priority: issue_types_1.IssuePriority.HIGH,
|
|
260
|
+
type: issue_types_1.IssueType.DOOR_LEFT_OPEN,
|
|
252
261
|
});
|
|
253
262
|
}
|
|
254
263
|
/**
|
|
@@ -265,6 +274,7 @@ let IssueService = (() => {
|
|
|
265
274
|
createdBy: source,
|
|
266
275
|
category: issue_types_1.IssuesCategory.ENERGY,
|
|
267
276
|
priority: issue_types_1.IssuePriority.MEDIUM,
|
|
277
|
+
type: issue_types_1.IssueType.BATTERY_LOW,
|
|
268
278
|
});
|
|
269
279
|
}
|
|
270
280
|
/**
|
|
@@ -281,6 +291,7 @@ let IssueService = (() => {
|
|
|
281
291
|
createdBy: source,
|
|
282
292
|
category: issue_types_1.IssuesCategory.OPERATIONS,
|
|
283
293
|
priority: issue_types_1.IssuePriority.HIGH,
|
|
294
|
+
type: issue_types_1.IssueType.DEVICE_MALFUNCTION,
|
|
284
295
|
});
|
|
285
296
|
}
|
|
286
297
|
/**
|
|
@@ -644,9 +655,7 @@ let IssueService = (() => {
|
|
|
644
655
|
if (!data.propertyId) {
|
|
645
656
|
throw new Error("Property ID is required");
|
|
646
657
|
}
|
|
647
|
-
|
|
648
|
-
throw new Error("Zone ID is required");
|
|
649
|
-
}
|
|
658
|
+
// Zone ID is now optional, so no validation needed
|
|
650
659
|
if (!data.createdBy) {
|
|
651
660
|
throw new Error("Created by user ID is required");
|
|
652
661
|
}
|
|
@@ -673,16 +682,19 @@ let IssueService = (() => {
|
|
|
673
682
|
issue_types_1.IssueStatus.IN_PROGRESS,
|
|
674
683
|
issue_types_1.IssueStatus.CANCELLED,
|
|
675
684
|
issue_types_1.IssueStatus.ON_HOLD,
|
|
685
|
+
issue_types_1.IssueStatus.IGNORED,
|
|
676
686
|
],
|
|
677
687
|
[issue_types_1.IssueStatus.IN_PROGRESS]: [
|
|
678
688
|
issue_types_1.IssueStatus.RESOLVED,
|
|
679
689
|
issue_types_1.IssueStatus.CANCELLED,
|
|
680
690
|
issue_types_1.IssueStatus.ON_HOLD,
|
|
691
|
+
issue_types_1.IssueStatus.IGNORED,
|
|
681
692
|
],
|
|
682
693
|
[issue_types_1.IssueStatus.RESOLVED]: [issue_types_1.IssueStatus.CLOSED, issue_types_1.IssueStatus.PENDING], // Reopen
|
|
683
694
|
[issue_types_1.IssueStatus.CLOSED]: [issue_types_1.IssueStatus.PENDING], // Reopen
|
|
684
695
|
[issue_types_1.IssueStatus.CANCELLED]: [issue_types_1.IssueStatus.PENDING], // Reopen
|
|
685
696
|
[issue_types_1.IssueStatus.ON_HOLD]: [issue_types_1.IssueStatus.PENDING, issue_types_1.IssueStatus.IN_PROGRESS],
|
|
697
|
+
[issue_types_1.IssueStatus.IGNORED]: [issue_types_1.IssueStatus.PENDING, issue_types_1.IssueStatus.IN_PROGRESS], // Reopen from ignored
|
|
686
698
|
};
|
|
687
699
|
if (!validTransitions[currentStatus]?.includes(newStatus)) {
|
|
688
700
|
throw new Error(`Invalid status transition from ${currentStatus} to ${newStatus}`);
|
|
@@ -31,9 +31,9 @@ export declare class IssueBuilder {
|
|
|
31
31
|
*/
|
|
32
32
|
setPropertyId(propertyId: string): this;
|
|
33
33
|
/**
|
|
34
|
-
* Sets the zone ID
|
|
34
|
+
* Sets the zone ID (optional)
|
|
35
35
|
*/
|
|
36
|
-
setZoneId(zoneId
|
|
36
|
+
setZoneId(zoneId?: string): this;
|
|
37
37
|
/**
|
|
38
38
|
* Sets the issue title
|
|
39
39
|
*/
|
|
@@ -89,25 +89,26 @@ export declare class IssueBuilder {
|
|
|
89
89
|
/**
|
|
90
90
|
* Creates a device-specific issue builder
|
|
91
91
|
*/
|
|
92
|
-
static createDeviceIssue(deviceId: string, propertyId: string, zoneId
|
|
92
|
+
static createDeviceIssue(deviceId: string, propertyId: string, zoneId?: string): IssueBuilder;
|
|
93
93
|
/**
|
|
94
94
|
* Creates a hub-specific issue builder
|
|
95
95
|
*/
|
|
96
|
-
static createHubIssue(hubId: string, propertyId: string, zoneId
|
|
96
|
+
static createHubIssue(hubId: string, propertyId: string, zoneId?: string): IssueBuilder;
|
|
97
97
|
/**
|
|
98
98
|
* Creates a user-specific issue builder
|
|
99
99
|
*/
|
|
100
|
-
static createUserIssue(userId: string, propertyId: string, zoneId
|
|
100
|
+
static createUserIssue(userId: string, propertyId: string, zoneId?: string): IssueBuilder;
|
|
101
101
|
/**
|
|
102
102
|
* Creates a property-specific issue builder
|
|
103
103
|
*/
|
|
104
|
-
static createPropertyIssue(propertyId: string, zoneId
|
|
104
|
+
static createPropertyIssue(propertyId: string, zoneId?: string): IssueBuilder;
|
|
105
105
|
/**
|
|
106
106
|
* Creates a maintenance issue builder
|
|
107
107
|
*/
|
|
108
|
-
static createMaintenanceIssue(propertyId: string, zoneId
|
|
108
|
+
static createMaintenanceIssue(propertyId: string, zoneId?: string, entityId?: string, entityType?: EntityType): IssueBuilder;
|
|
109
109
|
/**
|
|
110
110
|
* Creates an urgent issue builder
|
|
111
111
|
*/
|
|
112
|
-
static createUrgentIssue(propertyId: string, zoneId
|
|
112
|
+
static createUrgentIssue(propertyId: string, zoneId?: string, entityId?: string, entityType?: EntityType): IssueBuilder;
|
|
113
|
+
static createCloudAccountAuthorizationIssue(propertyId: string, entityId: string, entityType: EntityType): IssueBuilder;
|
|
113
114
|
}
|
|
@@ -45,13 +45,15 @@ class IssueBuilder {
|
|
|
45
45
|
return this;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
* Sets the zone ID
|
|
48
|
+
* Sets the zone ID (optional)
|
|
49
49
|
*/
|
|
50
50
|
setZoneId(zoneId) {
|
|
51
|
-
if (
|
|
52
|
-
|
|
51
|
+
if (zoneId !== undefined) {
|
|
52
|
+
if (zoneId.trim() === "") {
|
|
53
|
+
throw new Error("Zone ID cannot be empty if provided");
|
|
54
|
+
}
|
|
55
|
+
this.data.zoneId = zoneId.trim();
|
|
53
56
|
}
|
|
54
|
-
this.data.zoneId = zoneId;
|
|
55
57
|
return this;
|
|
56
58
|
}
|
|
57
59
|
/**
|
|
@@ -134,7 +136,6 @@ class IssueBuilder {
|
|
|
134
136
|
const requiredFields = [
|
|
135
137
|
"category",
|
|
136
138
|
"propertyId",
|
|
137
|
-
"zoneId",
|
|
138
139
|
"title",
|
|
139
140
|
"description",
|
|
140
141
|
"entityId",
|
|
@@ -192,41 +193,49 @@ class IssueBuilder {
|
|
|
192
193
|
* Creates a device-specific issue builder
|
|
193
194
|
*/
|
|
194
195
|
static createDeviceIssue(deviceId, propertyId, zoneId) {
|
|
195
|
-
|
|
196
|
+
const builder = new IssueBuilder()
|
|
196
197
|
.setEntityType(issue_types_1.EntityType.DEVICE)
|
|
197
198
|
.setEntityId(deviceId)
|
|
198
|
-
.setPropertyId(propertyId)
|
|
199
|
-
|
|
199
|
+
.setPropertyId(propertyId);
|
|
200
|
+
if (zoneId)
|
|
201
|
+
builder.setZoneId(zoneId);
|
|
202
|
+
return builder;
|
|
200
203
|
}
|
|
201
204
|
/**
|
|
202
205
|
* Creates a hub-specific issue builder
|
|
203
206
|
*/
|
|
204
207
|
static createHubIssue(hubId, propertyId, zoneId) {
|
|
205
|
-
|
|
208
|
+
const builder = new IssueBuilder()
|
|
206
209
|
.setEntityType(issue_types_1.EntityType.HUB)
|
|
207
210
|
.setEntityId(hubId)
|
|
208
|
-
.setPropertyId(propertyId)
|
|
209
|
-
|
|
211
|
+
.setPropertyId(propertyId);
|
|
212
|
+
if (zoneId)
|
|
213
|
+
builder.setZoneId(zoneId);
|
|
214
|
+
return builder;
|
|
210
215
|
}
|
|
211
216
|
/**
|
|
212
217
|
* Creates a user-specific issue builder
|
|
213
218
|
*/
|
|
214
219
|
static createUserIssue(userId, propertyId, zoneId) {
|
|
215
|
-
|
|
220
|
+
const builder = new IssueBuilder()
|
|
216
221
|
.setEntityType(issue_types_1.EntityType.USER)
|
|
217
222
|
.setEntityId(userId)
|
|
218
|
-
.setPropertyId(propertyId)
|
|
219
|
-
|
|
223
|
+
.setPropertyId(propertyId);
|
|
224
|
+
if (zoneId)
|
|
225
|
+
builder.setZoneId(zoneId);
|
|
226
|
+
return builder;
|
|
220
227
|
}
|
|
221
228
|
/**
|
|
222
229
|
* Creates a property-specific issue builder
|
|
223
230
|
*/
|
|
224
231
|
static createPropertyIssue(propertyId, zoneId) {
|
|
225
|
-
|
|
232
|
+
const builder = new IssueBuilder()
|
|
226
233
|
.setEntityType(issue_types_1.EntityType.PROPERTY)
|
|
227
234
|
.setEntityId(propertyId)
|
|
228
|
-
.setPropertyId(propertyId)
|
|
229
|
-
|
|
235
|
+
.setPropertyId(propertyId);
|
|
236
|
+
if (zoneId)
|
|
237
|
+
builder.setZoneId(zoneId);
|
|
238
|
+
return builder;
|
|
230
239
|
}
|
|
231
240
|
/**
|
|
232
241
|
* Creates a maintenance issue builder
|
|
@@ -234,13 +243,13 @@ class IssueBuilder {
|
|
|
234
243
|
static createMaintenanceIssue(propertyId, zoneId, entityId, entityType) {
|
|
235
244
|
const builder = new IssueBuilder()
|
|
236
245
|
.setCategory(issue_types_1.IssuesCategory.READINESS)
|
|
237
|
-
.setPropertyId(propertyId)
|
|
238
|
-
.setZoneId(zoneId)
|
|
239
|
-
.setPriority(issue_types_1.IssuePriority.MEDIUM);
|
|
246
|
+
.setPropertyId(propertyId);
|
|
240
247
|
if (entityId)
|
|
241
248
|
builder.setEntityId(entityId);
|
|
242
249
|
if (entityType)
|
|
243
250
|
builder.setEntityType(entityType);
|
|
251
|
+
if (zoneId)
|
|
252
|
+
builder.setZoneId(zoneId);
|
|
244
253
|
return builder;
|
|
245
254
|
}
|
|
246
255
|
/**
|
|
@@ -250,12 +259,20 @@ class IssueBuilder {
|
|
|
250
259
|
const builder = new IssueBuilder()
|
|
251
260
|
.setCategory(issue_types_1.IssuesCategory.OPERATIONS)
|
|
252
261
|
.setPropertyId(propertyId)
|
|
253
|
-
.setZoneId(zoneId)
|
|
254
262
|
.setPriority(issue_types_1.IssuePriority.URGENT);
|
|
255
263
|
if (entityId)
|
|
256
264
|
builder.setEntityId(entityId);
|
|
257
265
|
if (entityType)
|
|
258
266
|
builder.setEntityType(entityType);
|
|
267
|
+
if (zoneId)
|
|
268
|
+
builder.setZoneId(zoneId);
|
|
269
|
+
return builder;
|
|
270
|
+
}
|
|
271
|
+
static createCloudAccountAuthorizationIssue(propertyId, entityId, entityType) {
|
|
272
|
+
const builder = new IssueBuilder()
|
|
273
|
+
.setEntityType(entityType)
|
|
274
|
+
.setEntityId(entityId)
|
|
275
|
+
.setPropertyId(propertyId);
|
|
259
276
|
return builder;
|
|
260
277
|
}
|
|
261
278
|
}
|
|
@@ -14,7 +14,9 @@ export declare enum EntityType {
|
|
|
14
14
|
HUB = "HUB",
|
|
15
15
|
SCHEDULE = "SCHEDULE",
|
|
16
16
|
ALERT = "ALERT",
|
|
17
|
-
OTHER = "OTHER"
|
|
17
|
+
OTHER = "OTHER",
|
|
18
|
+
CLOUD_DEVICE_ACCOUNT = "CLOUD_DEVICE_ACCOUNT",
|
|
19
|
+
CLOUD_PMS_ACCOUNT = "CLOUD_PMS_ACCOUNT"
|
|
18
20
|
}
|
|
19
21
|
export declare enum IssueStatus {
|
|
20
22
|
PENDING = "PENDING",
|
|
@@ -22,7 +24,8 @@ export declare enum IssueStatus {
|
|
|
22
24
|
RESOLVED = "RESOLVED",
|
|
23
25
|
CLOSED = "CLOSED",
|
|
24
26
|
CANCELLED = "CANCELLED",
|
|
25
|
-
ON_HOLD = "ON_HOLD"
|
|
27
|
+
ON_HOLD = "ON_HOLD",
|
|
28
|
+
IGNORED = "IGNORED"
|
|
26
29
|
}
|
|
27
30
|
export declare enum IssuePriority {
|
|
28
31
|
LOW = "LOW",
|
|
@@ -38,17 +41,36 @@ export interface IssueComment {
|
|
|
38
41
|
createdAt: Date;
|
|
39
42
|
updatedAt?: Date;
|
|
40
43
|
}
|
|
44
|
+
export declare enum IssueType {
|
|
45
|
+
BATTERY_LOW = "BATTERY_LOW",
|
|
46
|
+
DEVICE_OFFLINE = "DEVICE_OFFLINE",
|
|
47
|
+
HUB_OFFLINE = "HUB_OFFLINE",
|
|
48
|
+
ACCOUNT_UNAUTHORIZED = "ACCOUNT_UNAUTHORIZED",
|
|
49
|
+
ACCOUNT_NEW_DEVICE = "ACCOUNT_NEW_DEVICE",
|
|
50
|
+
ACCOUNT_MISSING_DEVICE = "ACCOUNT_MISSING_DEVICE",
|
|
51
|
+
DEVICE_TAMPER_ATTEMPT = "DEVICE_TAMPER_ATTEMPT",
|
|
52
|
+
LOCK_JAMMED = "LOCK_JAMMED",
|
|
53
|
+
DEVICE_MALFUNCTION = "DEVICE_MALFUNCTION",
|
|
54
|
+
DOOR_LEFT_OPEN = "DOOR_LEFT_OPEN",
|
|
55
|
+
DOOR_OPEN_FREQUENT = "DOOR_OPEN_FREQUENT",
|
|
56
|
+
DOOR_OPEN_OUTSIDE_BIZ_HOURS = "DOOR_OPEN_OUTSIDE_BIZ_HOURS",
|
|
57
|
+
LOCK_ACCESS_EMERGENCY_CODE = "LOCK_ACCESS_EMERGENCY_CODE",
|
|
58
|
+
LOCK_ACCESS_MASTER_CODE = "LOCK_ACCESS_MASTER_CODE",
|
|
59
|
+
SPECIFIC_DOOR_ACCESS = "SPECIFIC_DOOR_ACCESS",
|
|
60
|
+
GUEST_LOCK_FIRST_ACCESS = "GUEST_LOCK_FIRST_ACCESS"
|
|
61
|
+
}
|
|
41
62
|
export interface IssueDocument {
|
|
42
63
|
_id: string;
|
|
43
64
|
category: IssuesCategory;
|
|
44
65
|
propertyId: string;
|
|
45
|
-
zoneId
|
|
66
|
+
zoneId?: string;
|
|
46
67
|
title: string;
|
|
47
68
|
description: string;
|
|
48
69
|
entityId?: string;
|
|
49
70
|
entityType: EntityType;
|
|
50
71
|
status: IssueStatus;
|
|
51
72
|
priority: IssuePriority;
|
|
73
|
+
type: IssueType;
|
|
52
74
|
assignedTo?: string;
|
|
53
75
|
createdBy: string;
|
|
54
76
|
updatedBy?: string;
|
|
@@ -62,11 +84,12 @@ export interface IssueDocument {
|
|
|
62
84
|
export interface CreateIssueData {
|
|
63
85
|
category: IssuesCategory;
|
|
64
86
|
propertyId: string;
|
|
65
|
-
zoneId
|
|
87
|
+
zoneId?: string;
|
|
66
88
|
title: string;
|
|
67
89
|
description: string;
|
|
68
90
|
entityId: string;
|
|
69
91
|
entityType: EntityType;
|
|
92
|
+
type: IssueType;
|
|
70
93
|
priority?: IssuePriority;
|
|
71
94
|
assignedTo?: string;
|
|
72
95
|
createdBy: string;
|
|
@@ -79,6 +102,7 @@ export interface UpdateIssueData {
|
|
|
79
102
|
entityId?: string;
|
|
80
103
|
entityType?: EntityType;
|
|
81
104
|
status?: IssueStatus;
|
|
105
|
+
type?: IssueType;
|
|
82
106
|
priority?: IssuePriority;
|
|
83
107
|
assignedTo?: string;
|
|
84
108
|
updatedBy?: string;
|
|
@@ -96,6 +120,7 @@ export interface IIssueQuery {
|
|
|
96
120
|
assignedTo?: string;
|
|
97
121
|
status?: IssueStatus;
|
|
98
122
|
priority?: IssuePriority;
|
|
123
|
+
type?: IssueType;
|
|
99
124
|
category?: IssuesCategory;
|
|
100
125
|
entityType?: EntityType;
|
|
101
126
|
entityId?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IssuePriority = exports.IssueStatus = exports.EntityType = exports.IssuesCategory = void 0;
|
|
3
|
+
exports.IssueType = exports.IssuePriority = exports.IssueStatus = exports.EntityType = exports.IssuesCategory = void 0;
|
|
4
4
|
var IssuesCategory;
|
|
5
5
|
(function (IssuesCategory) {
|
|
6
6
|
IssuesCategory["READINESS"] = "READINESS";
|
|
@@ -20,6 +20,8 @@ var EntityType;
|
|
|
20
20
|
EntityType["SCHEDULE"] = "SCHEDULE";
|
|
21
21
|
EntityType["ALERT"] = "ALERT";
|
|
22
22
|
EntityType["OTHER"] = "OTHER";
|
|
23
|
+
EntityType["CLOUD_DEVICE_ACCOUNT"] = "CLOUD_DEVICE_ACCOUNT";
|
|
24
|
+
EntityType["CLOUD_PMS_ACCOUNT"] = "CLOUD_PMS_ACCOUNT";
|
|
23
25
|
})(EntityType || (exports.EntityType = EntityType = {}));
|
|
24
26
|
var IssueStatus;
|
|
25
27
|
(function (IssueStatus) {
|
|
@@ -29,6 +31,7 @@ var IssueStatus;
|
|
|
29
31
|
IssueStatus["CLOSED"] = "CLOSED";
|
|
30
32
|
IssueStatus["CANCELLED"] = "CANCELLED";
|
|
31
33
|
IssueStatus["ON_HOLD"] = "ON_HOLD";
|
|
34
|
+
IssueStatus["IGNORED"] = "IGNORED";
|
|
32
35
|
})(IssueStatus || (exports.IssueStatus = IssueStatus = {}));
|
|
33
36
|
var IssuePriority;
|
|
34
37
|
(function (IssuePriority) {
|
|
@@ -38,3 +41,22 @@ var IssuePriority;
|
|
|
38
41
|
IssuePriority["CRITICAL"] = "CRITICAL";
|
|
39
42
|
IssuePriority["URGENT"] = "URGENT";
|
|
40
43
|
})(IssuePriority || (exports.IssuePriority = IssuePriority = {}));
|
|
44
|
+
var IssueType;
|
|
45
|
+
(function (IssueType) {
|
|
46
|
+
IssueType["BATTERY_LOW"] = "BATTERY_LOW";
|
|
47
|
+
IssueType["DEVICE_OFFLINE"] = "DEVICE_OFFLINE";
|
|
48
|
+
IssueType["HUB_OFFLINE"] = "HUB_OFFLINE";
|
|
49
|
+
IssueType["ACCOUNT_UNAUTHORIZED"] = "ACCOUNT_UNAUTHORIZED";
|
|
50
|
+
IssueType["ACCOUNT_NEW_DEVICE"] = "ACCOUNT_NEW_DEVICE";
|
|
51
|
+
IssueType["ACCOUNT_MISSING_DEVICE"] = "ACCOUNT_MISSING_DEVICE";
|
|
52
|
+
IssueType["DEVICE_TAMPER_ATTEMPT"] = "DEVICE_TAMPER_ATTEMPT";
|
|
53
|
+
IssueType["LOCK_JAMMED"] = "LOCK_JAMMED";
|
|
54
|
+
IssueType["DEVICE_MALFUNCTION"] = "DEVICE_MALFUNCTION";
|
|
55
|
+
IssueType["DOOR_LEFT_OPEN"] = "DOOR_LEFT_OPEN";
|
|
56
|
+
IssueType["DOOR_OPEN_FREQUENT"] = "DOOR_OPEN_FREQUENT";
|
|
57
|
+
IssueType["DOOR_OPEN_OUTSIDE_BIZ_HOURS"] = "DOOR_OPEN_OUTSIDE_BIZ_HOURS";
|
|
58
|
+
IssueType["LOCK_ACCESS_EMERGENCY_CODE"] = "LOCK_ACCESS_EMERGENCY_CODE";
|
|
59
|
+
IssueType["LOCK_ACCESS_MASTER_CODE"] = "LOCK_ACCESS_MASTER_CODE";
|
|
60
|
+
IssueType["SPECIFIC_DOOR_ACCESS"] = "SPECIFIC_DOOR_ACCESS";
|
|
61
|
+
IssueType["GUEST_LOCK_FIRST_ACCESS"] = "GUEST_LOCK_FIRST_ACCESS";
|
|
62
|
+
})(IssueType || (exports.IssueType = IssueType = {}));
|