dt-common-device 11.0.4 → 11.1.0

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.
@@ -18,6 +18,7 @@ export declare class AuditUtils {
18
18
  private getPropertyName;
19
19
  private getFieldFromDevice;
20
20
  private getUserName;
21
+ private getGuestName;
21
22
  private getDeviceName;
22
23
  private getZoneName;
23
24
  private getAccessGroupName;
@@ -162,21 +162,20 @@ let AuditUtils = (() => {
162
162
  if (userId && !userName)
163
163
  audit.userName = await this.getUserName(userId);
164
164
  if (guestId && !guestName)
165
- audit.guestName = "Guest";
166
- if (guestName)
167
- audit.guestName = "Guest";
165
+ audit.guestName = await this.getGuestName(guestId);
168
166
  if (deviceId && !deviceName) {
169
167
  audit.deviceName = await this.getDeviceName(deviceId);
170
168
  }
171
169
  if (accessGroupId && !accessGroupName)
172
170
  audit.accessGroupName = await this.getAccessGroupName(accessGroupId);
173
171
  if (scheduleId) {
174
- const { scheduleStartDate, scheduleEndDate, scheduleDuration, scheduleSource, scheduleStatus, } = await this.getScheduleDetails(scheduleId);
172
+ const { scheduleStartDate, scheduleEndDate, scheduleDuration, scheduleSource, scheduleStatus, referenceId, } = await this.getScheduleDetails(scheduleId);
175
173
  audit.scheduleStartDate = scheduleStartDate;
176
174
  audit.scheduleEndDate = scheduleEndDate;
177
175
  audit.scheduleDuration = scheduleDuration;
178
176
  audit.scheduleSource = scheduleSource;
179
177
  audit.scheduleStatus = scheduleStatus;
178
+ audit.referenceId = referenceId;
180
179
  }
181
180
  }
182
181
  catch (error) {
@@ -256,6 +255,20 @@ let AuditUtils = (() => {
256
255
  return "";
257
256
  }
258
257
  }
258
+ async getGuestName(guestId) {
259
+ try {
260
+ return await this.getCachedEntityData("guest", guestId, async () => {
261
+ const guest = await typedi_1.default.get(pms_1.PmsService).getGuest(guestId);
262
+ if (!guest)
263
+ return "";
264
+ return `${guest?.firstName || ""} ${guest?.lastName || ""}`.trim();
265
+ });
266
+ }
267
+ catch (error) {
268
+ (0, config_1.getLogger)().error(`Error in getGuestName: ${error instanceof Error ? error.message : error}`);
269
+ return "";
270
+ }
271
+ }
259
272
  async getDeviceName(deviceId) {
260
273
  try {
261
274
  return await this.getCachedEntityData("device", deviceId, async () => {
@@ -309,6 +322,7 @@ let AuditUtils = (() => {
309
322
  scheduleDuration: 0,
310
323
  scheduleSource: "",
311
324
  scheduleStatus: "",
325
+ referenceId: "",
312
326
  };
313
327
  }
314
328
  const scheduleDuration = this.calculateScheduleDuration(schedule.startTime, schedule.endTime);
@@ -318,6 +332,7 @@ let AuditUtils = (() => {
318
332
  scheduleDuration,
319
333
  scheduleSource: schedule.source,
320
334
  scheduleStatus: schedule.status,
335
+ referenceId: schedule.referenceId,
321
336
  };
322
337
  });
323
338
  }
@@ -329,6 +344,7 @@ let AuditUtils = (() => {
329
344
  scheduleDuration: 0,
330
345
  scheduleSource: "",
331
346
  scheduleStatus: "",
347
+ referenceId: "",
332
348
  };
333
349
  }
334
350
  }
@@ -502,9 +502,9 @@ let IssueService = (() => {
502
502
  this.validateStatusTransition(existingIssue.status, updateData.status);
503
503
  }
504
504
  // Business logic: Handle priority changes
505
- if (updateData.priority) {
506
- this.validatePriorityChange(existingIssue.priority, updateData.priority);
507
- }
505
+ // if (updateData.priority) {
506
+ // this.validatePriorityChange(existingIssue.priority, updateData.priority);
507
+ // }
508
508
  return await this.issueRepository.update(id, updateData);
509
509
  }
510
510
  async deleteIssues(filters, deletedBy, softDelete = true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dt-common-device",
3
- "version": "11.0.4",
3
+ "version": "11.1.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [