grm-shared-library 1.0.141 → 1.0.142

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.
@@ -1,5 +1,6 @@
1
1
  export declare class IncidentActionDto {
2
- action: string;
3
- timestamp: Date;
2
+ incidentId: number;
4
3
  userId: number;
4
+ action: string;
5
+ timestamp: string;
5
6
  }
@@ -14,6 +14,16 @@ const class_validator_1 = require("class-validator");
14
14
  class IncidentActionDto {
15
15
  }
16
16
  exports.IncidentActionDto = IncidentActionDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsNumber)(),
19
+ (0, class_validator_1.IsNotEmpty)(),
20
+ __metadata("design:type", Number)
21
+ ], IncidentActionDto.prototype, "incidentId", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsNumber)(),
24
+ (0, class_validator_1.IsNotEmpty)(),
25
+ __metadata("design:type", Number)
26
+ ], IncidentActionDto.prototype, "userId", void 0);
17
27
  __decorate([
18
28
  (0, class_validator_1.IsString)(),
19
29
  (0, class_validator_1.IsNotEmpty)(),
@@ -22,10 +32,5 @@ __decorate([
22
32
  __decorate([
23
33
  (0, class_validator_1.IsDateString)(),
24
34
  (0, class_validator_1.IsNotEmpty)(),
25
- __metadata("design:type", Date)
35
+ __metadata("design:type", String)
26
36
  ], IncidentActionDto.prototype, "timestamp", void 0);
27
- __decorate([
28
- (0, class_validator_1.IsNumber)(),
29
- (0, class_validator_1.IsNotEmpty)(),
30
- __metadata("design:type", Number)
31
- ], IncidentActionDto.prototype, "userId", void 0);
@@ -1,7 +1,6 @@
1
1
  import { IncidentAppId } from "../../enums/incident-app-id.enum";
2
2
  import { IncidentClass } from "../../enums/incident-class.enum";
3
3
  import { IncidentChannel } from "../../enums/incident-channel.enum";
4
- import { IncidentActionDto } from "../action/incident-action.dto";
5
4
  import { IncidentPriority } from "../../enums/incident-priority.enum";
6
5
  import { MapLocationDto } from "../../../common";
7
6
  import { IncidentReporterDto } from "../reporter/incident-reporter.dto";
@@ -15,7 +14,6 @@ export declare class CreateIncidentDto {
15
14
  typeId?: number;
16
15
  description?: string;
17
16
  status: string;
18
- action: IncidentActionDto;
19
17
  priority?: IncidentPriority;
20
18
  location?: MapLocationDto;
21
19
  controlCentreId: number;
@@ -15,10 +15,10 @@ const incident_app_id_enum_1 = require("../../enums/incident-app-id.enum");
15
15
  const incident_class_enum_1 = require("../../enums/incident-class.enum");
16
16
  const incident_channel_enum_1 = require("../../enums/incident-channel.enum");
17
17
  const class_transformer_1 = require("class-transformer");
18
- const incident_action_dto_1 = require("../action/incident-action.dto");
19
18
  const incident_priority_enum_1 = require("../../enums/incident-priority.enum");
20
19
  const common_1 = require("../../../common");
21
20
  const incident_reporter_dto_1 = require("../reporter/incident-reporter.dto");
21
+ const incident_status_enum_1 = require("../../enums/incident-status.enum");
22
22
  class CreateIncidentDto {
23
23
  }
24
24
  exports.CreateIncidentDto = CreateIncidentDto;
@@ -64,16 +64,10 @@ __decorate([
64
64
  __metadata("design:type", String)
65
65
  ], CreateIncidentDto.prototype, "description", void 0);
66
66
  __decorate([
67
- (0, class_validator_1.IsString)(),
67
+ (0, class_validator_1.IsEnum)(incident_status_enum_1.IncidentStatus),
68
68
  (0, class_validator_1.IsNotEmpty)(),
69
69
  __metadata("design:type", String)
70
70
  ], CreateIncidentDto.prototype, "status", void 0);
71
- __decorate([
72
- (0, class_validator_1.ValidateNested)(),
73
- (0, class_transformer_1.Type)(() => incident_action_dto_1.IncidentActionDto),
74
- (0, class_validator_1.IsNotEmpty)(),
75
- __metadata("design:type", incident_action_dto_1.IncidentActionDto)
76
- ], CreateIncidentDto.prototype, "action", void 0);
77
71
  __decorate([
78
72
  (0, class_validator_1.IsEnum)(incident_priority_enum_1.IncidentPriority),
79
73
  (0, class_validator_1.IsOptional)(),
@@ -1,10 +1,12 @@
1
1
  import { CreateIncidentDto } from "./create-incident.dto";
2
2
  import { CreateIncidentCategoryDto } from "../category/create-incident-category.dto";
3
3
  import { CreateIncidentTypeDto } from "../type/create-incident-type.dto";
4
+ import { IncidentActionDto } from "../action/incident-action.dto";
4
5
  export declare class IncidentDto extends CreateIncidentDto {
5
6
  id: number;
6
7
  createdAt: string;
7
8
  updatedAt: string;
8
9
  category?: CreateIncidentCategoryDto;
9
10
  type?: CreateIncidentTypeDto;
11
+ actions?: IncidentActionDto[];
10
12
  }
@@ -15,6 +15,7 @@ const create_incident_dto_1 = require("./create-incident.dto");
15
15
  const class_transformer_1 = require("class-transformer");
16
16
  const create_incident_category_dto_1 = require("../category/create-incident-category.dto");
17
17
  const create_incident_type_dto_1 = require("../type/create-incident-type.dto");
18
+ const incident_action_dto_1 = require("../action/incident-action.dto");
18
19
  class IncidentDto extends create_incident_dto_1.CreateIncidentDto {
19
20
  }
20
21
  exports.IncidentDto = IncidentDto;
@@ -45,3 +46,10 @@ __decorate([
45
46
  (0, class_validator_1.IsOptional)(),
46
47
  __metadata("design:type", create_incident_type_dto_1.CreateIncidentTypeDto)
47
48
  ], IncidentDto.prototype, "type", void 0);
49
+ __decorate([
50
+ (0, class_validator_1.IsArray)(),
51
+ (0, class_validator_1.ValidateNested)({ each: true }),
52
+ (0, class_transformer_1.Type)(() => incident_action_dto_1.IncidentActionDto),
53
+ (0, class_validator_1.IsOptional)(),
54
+ __metadata("design:type", Array)
55
+ ], IncidentDto.prototype, "actions", void 0);
@@ -0,0 +1,16 @@
1
+ export declare enum IncidentStatus {
2
+ RECEIVED = "Received",
3
+ PENDING = "Pending",
4
+ IN_PROGRESS = "In-Progress",
5
+ ON_HOLD = "On-Hold",
6
+ CANCELLED = "Cancelled",
7
+ ESCALATED = "Escalated",
8
+ ASSIGNED = "Assigned",
9
+ RE_ASSIGNED = "Re-assigned",
10
+ IN_REVIEW = "In-Review",
11
+ RESOLVED = "Resolved",
12
+ CLOSED = "Closed",
13
+ REOPENED = "Reopened",
14
+ OVERDUE = "Overdue",
15
+ ARCHIVED = "Archived"
16
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IncidentStatus = void 0;
4
+ var IncidentStatus;
5
+ (function (IncidentStatus) {
6
+ IncidentStatus["RECEIVED"] = "Received";
7
+ IncidentStatus["PENDING"] = "Pending";
8
+ IncidentStatus["IN_PROGRESS"] = "In-Progress";
9
+ IncidentStatus["ON_HOLD"] = "On-Hold";
10
+ IncidentStatus["CANCELLED"] = "Cancelled";
11
+ IncidentStatus["ESCALATED"] = "Escalated";
12
+ IncidentStatus["ASSIGNED"] = "Assigned";
13
+ IncidentStatus["RE_ASSIGNED"] = "Re-assigned";
14
+ IncidentStatus["IN_REVIEW"] = "In-Review";
15
+ IncidentStatus["RESOLVED"] = "Resolved";
16
+ IncidentStatus["CLOSED"] = "Closed";
17
+ IncidentStatus["REOPENED"] = "Reopened";
18
+ IncidentStatus["OVERDUE"] = "Overdue";
19
+ IncidentStatus["ARCHIVED"] = "Archived";
20
+ })(IncidentStatus || (exports.IncidentStatus = IncidentStatus = {}));
@@ -13,6 +13,7 @@ export * from './enums/incident-app-id.enum';
13
13
  export * from './enums/incident-channel.enum';
14
14
  export * from './enums/incident-class.enum';
15
15
  export * from './enums/incident-priority.enum';
16
+ export * from './enums/incident-status.enum';
16
17
  export * from './intefaces/incident';
17
18
  export * from './intefaces/incident-action';
18
19
  export * from './intefaces/incident-attachment';
@@ -31,6 +31,7 @@ __exportStar(require("./enums/incident-app-id.enum"), exports);
31
31
  __exportStar(require("./enums/incident-channel.enum"), exports);
32
32
  __exportStar(require("./enums/incident-class.enum"), exports);
33
33
  __exportStar(require("./enums/incident-priority.enum"), exports);
34
+ __exportStar(require("./enums/incident-status.enum"), exports);
34
35
  //Interfaces
35
36
  __exportStar(require("./intefaces/incident"), exports);
36
37
  __exportStar(require("./intefaces/incident-action"), exports);
@@ -1,5 +1,7 @@
1
1
  export interface IncidentAction {
2
- action: string;
3
- timestamp: Date;
2
+ id?: number;
3
+ incidentId: number;
4
4
  userId: number;
5
+ action: string;
6
+ timestamp: string;
5
7
  }
@@ -3,6 +3,7 @@ import { IncidentAppId } from "../enums/incident-app-id.enum";
3
3
  import { IncidentChannel } from "../enums/incident-channel.enum";
4
4
  import { IncidentClass } from "../enums/incident-class.enum";
5
5
  import { IncidentPriority } from "../enums/incident-priority.enum";
6
+ import { IncidentStatus } from "../enums/incident-status.enum";
6
7
  import { IncidentAction } from "./incident-action";
7
8
  import { IncidentCategory } from "./incident-category";
8
9
  import { IncidentReporter } from "./incident-reporter";
@@ -17,8 +18,7 @@ export interface Incident {
17
18
  categoryId: number;
18
19
  typeId: number;
19
20
  description?: string;
20
- status: string;
21
- action: IncidentAction;
21
+ status: IncidentStatus;
22
22
  priority?: IncidentPriority;
23
23
  location?: MapLocation;
24
24
  controlCentreId: number;
@@ -27,4 +27,5 @@ export interface Incident {
27
27
  updatedAt?: Date;
28
28
  category?: IncidentCategory;
29
29
  type?: IncidentType;
30
+ actions?: IncidentAction[];
30
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grm-shared-library",
3
- "version": "1.0.141",
3
+ "version": "1.0.142",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [