grm-shared-library 1.0.182 → 1.0.184

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.
@@ -2,6 +2,6 @@ export declare class CreateIncidentAssignmentDto {
2
2
  incidentId: number;
3
3
  comments?: string;
4
4
  assignerId: number;
5
- assigneeIds?: number[];
5
+ assigneeIds: number[];
6
6
  timestamp: Date;
7
7
  }
@@ -33,7 +33,7 @@ __decorate([
33
33
  __decorate([
34
34
  (0, class_validator_1.IsArray)(),
35
35
  (0, class_validator_1.IsNumber)({}, { each: true }),
36
- (0, class_validator_1.IsOptional)(),
36
+ (0, class_validator_1.IsNotEmpty)(),
37
37
  __metadata("design:type", Array)
38
38
  ], CreateIncidentAssignmentDto.prototype, "assigneeIds", void 0);
39
39
  __decorate([
@@ -3,12 +3,14 @@ import { CreateIncidentCategoryDto } from "../category/create-incident-category.
3
3
  import { CreateIncidentTypeDto } from "../type/create-incident-type.dto";
4
4
  import { IncidentActionDto } from "../action/incident-action.dto";
5
5
  import { IncidentAssignmentDto } from "../assignment/incident-assignment.dto";
6
+ import { IncidentResponseUnitAssignmentDto } from "../response-unit-assignment/update-incident-response-unit-assignment.dto";
6
7
  export declare class IncidentDto extends CreateIncidentDto {
7
8
  id: number;
8
9
  category?: CreateIncidentCategoryDto;
9
10
  type?: CreateIncidentTypeDto;
10
11
  actions?: IncidentActionDto[];
11
12
  assignments?: IncidentAssignmentDto[];
13
+ responseUnitAssignments?: IncidentResponseUnitAssignmentDto[];
12
14
  createdAt: string;
13
15
  updatedAt: string;
14
16
  }
@@ -17,6 +17,7 @@ const create_incident_category_dto_1 = require("../category/create-incident-cate
17
17
  const create_incident_type_dto_1 = require("../type/create-incident-type.dto");
18
18
  const incident_action_dto_1 = require("../action/incident-action.dto");
19
19
  const incident_assignment_dto_1 = require("../assignment/incident-assignment.dto");
20
+ const update_incident_response_unit_assignment_dto_1 = require("../response-unit-assignment/update-incident-response-unit-assignment.dto");
20
21
  class IncidentDto extends create_incident_dto_1.CreateIncidentDto {
21
22
  }
22
23
  exports.IncidentDto = IncidentDto;
@@ -51,6 +52,13 @@ __decorate([
51
52
  (0, class_transformer_1.Type)(() => incident_assignment_dto_1.IncidentAssignmentDto),
52
53
  __metadata("design:type", Array)
53
54
  ], IncidentDto.prototype, "assignments", void 0);
55
+ __decorate([
56
+ (0, class_validator_1.IsArray)(),
57
+ (0, class_validator_1.IsOptional)(),
58
+ (0, class_validator_1.ValidateNested)({ each: true }),
59
+ (0, class_transformer_1.Type)(() => update_incident_response_unit_assignment_dto_1.IncidentResponseUnitAssignmentDto),
60
+ __metadata("design:type", Array)
61
+ ], IncidentDto.prototype, "responseUnitAssignments", void 0);
54
62
  __decorate([
55
63
  (0, class_validator_1.IsDateString)(),
56
64
  (0, class_validator_1.IsNotEmpty)(),
@@ -0,0 +1,8 @@
1
+ export declare class CreateIncidentResponseUnitAssignmentDto {
2
+ id?: number;
3
+ incidentId: number;
4
+ assignedResponseUnitIds: number[];
5
+ assignerId: number;
6
+ comments?: string;
7
+ timestamp: Date;
8
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateIncidentResponseUnitAssignmentDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class CreateIncidentResponseUnitAssignmentDto {
15
+ }
16
+ exports.CreateIncidentResponseUnitAssignmentDto = CreateIncidentResponseUnitAssignmentDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsNumber)(),
19
+ (0, class_validator_1.IsOptional)(),
20
+ __metadata("design:type", Number)
21
+ ], CreateIncidentResponseUnitAssignmentDto.prototype, "id", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsNumber)(),
24
+ (0, class_validator_1.IsNotEmpty)(),
25
+ __metadata("design:type", Number)
26
+ ], CreateIncidentResponseUnitAssignmentDto.prototype, "incidentId", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsArray)(),
29
+ (0, class_validator_1.IsNumber)({}, { each: true }),
30
+ (0, class_validator_1.IsNotEmpty)(),
31
+ __metadata("design:type", Array)
32
+ ], CreateIncidentResponseUnitAssignmentDto.prototype, "assignedResponseUnitIds", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsNumber)(),
35
+ (0, class_validator_1.IsNotEmpty)(),
36
+ __metadata("design:type", Number)
37
+ ], CreateIncidentResponseUnitAssignmentDto.prototype, "assignerId", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.IsString)(),
40
+ (0, class_validator_1.IsOptional)(),
41
+ (0, class_validator_1.MaxLength)(2000),
42
+ __metadata("design:type", String)
43
+ ], CreateIncidentResponseUnitAssignmentDto.prototype, "comments", void 0);
44
+ __decorate([
45
+ (0, class_validator_1.IsDate)(),
46
+ (0, class_validator_1.IsNotEmpty)(),
47
+ __metadata("design:type", Date)
48
+ ], CreateIncidentResponseUnitAssignmentDto.prototype, "timestamp", void 0);
@@ -0,0 +1,5 @@
1
+ import { CreateIncidentResponseUnitAssignmentDto } from "./create-incident-response-unit-assignment.dto";
2
+ declare const UpdateIncidentResponseUnitAssignmentDto_base: import("@nestjs/mapped-types").MappedType<Partial<CreateIncidentResponseUnitAssignmentDto>>;
3
+ export declare class UpdateIncidentResponseUnitAssignmentDto extends UpdateIncidentResponseUnitAssignmentDto_base {
4
+ }
5
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateIncidentResponseUnitAssignmentDto = void 0;
4
+ const mapped_types_1 = require("@nestjs/mapped-types");
5
+ const create_incident_response_unit_assignment_dto_1 = require("./create-incident-response-unit-assignment.dto");
6
+ class UpdateIncidentResponseUnitAssignmentDto extends (0, mapped_types_1.PartialType)(create_incident_response_unit_assignment_dto_1.CreateIncidentResponseUnitAssignmentDto) {
7
+ }
8
+ exports.UpdateIncidentResponseUnitAssignmentDto = UpdateIncidentResponseUnitAssignmentDto;
@@ -0,0 +1,7 @@
1
+ import { CreateIncidentResponseUnitAssignmentDto } from "./create-incident-response-unit-assignment.dto";
2
+ declare const IncidentResponseUnitAssignmentDto_base: import("@nestjs/mapped-types").MappedType<Omit<CreateIncidentResponseUnitAssignmentDto, "timestamp">>;
3
+ export declare class IncidentResponseUnitAssignmentDto extends IncidentResponseUnitAssignmentDto_base {
4
+ id: number;
5
+ timestamp: string;
6
+ }
7
+ export {};
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.IncidentResponseUnitAssignmentDto = void 0;
13
+ const mapped_types_1 = require("@nestjs/mapped-types");
14
+ const create_incident_response_unit_assignment_dto_1 = require("./create-incident-response-unit-assignment.dto");
15
+ const class_validator_1 = require("class-validator");
16
+ class IncidentResponseUnitAssignmentDto extends (0, mapped_types_1.OmitType)(create_incident_response_unit_assignment_dto_1.CreateIncidentResponseUnitAssignmentDto, ['timestamp']) {
17
+ }
18
+ exports.IncidentResponseUnitAssignmentDto = IncidentResponseUnitAssignmentDto;
19
+ __decorate([
20
+ (0, class_validator_1.IsNumber)(),
21
+ (0, class_validator_1.IsNotEmpty)(),
22
+ __metadata("design:type", Number)
23
+ ], IncidentResponseUnitAssignmentDto.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, class_validator_1.IsDateString)(),
26
+ (0, class_validator_1.IsNotEmpty)(),
27
+ __metadata("design:type", String)
28
+ ], IncidentResponseUnitAssignmentDto.prototype, "timestamp", void 0);
@@ -1,14 +1,38 @@
1
1
  export declare enum IncidentStatus {
2
2
  RECEIVED = "Received",
3
- PENDING = "Pending",
4
3
  IN_PROGRESS = "In-Progress",
4
+ IN_REVIEW = "In-Review",
5
5
  ON_HOLD = "On-Hold",
6
6
  ESCALATED = "Escalated",
7
- IN_REVIEW = "In-Review",
8
7
  RESOLVED = "Resolved",
9
8
  APPEALED = "Appealed",
10
9
  CLOSED = "Closed",
11
10
  UNRESOLVED = "Unresolved",
12
- OVERDUE = "Overdue",
13
11
  ARCHIVED = "Archived"
14
12
  }
13
+ /**
14
+ * When an incident is first created it will be created in the DB with the default status Received.
15
+ * Thereafter it can be changed from status Received to any of the stage 1 statuses or Resolved or Escalated statuses in stage 2.
16
+ * An incident cannot change from any of the stage 1 statuses to status Appealed, Closed, Unresolved or Archived
17
+ * An incident CANNOT be changed back to status Received
18
+ * An incident with status Resolved can ONLY be changed to status Appealed, Closed or Unresolved
19
+ * An incident with status Appealed can ONLY be changed to status Escalated, Resolved or Unresolved
20
+ * An incident can ONLY be changed to status Appealed from status Resolved
21
+ * An incident with status Unresolved can only be changed to Resolved
22
+ * An incident with status Escalated can ONLY be changed to status Resolved or Unresolved
23
+ * An incident MUST first be changed to Resolved before status Closed
24
+ * Once an incident is Closed, it CANNOT be changed back to any other statuses apart from Archived
25
+ * An incident with status Archived CANNOT be changed to any other status
26
+ */
27
+ /**
28
+ * Transition map (simplified):
29
+ * - Received → In-Progress | In-Review | On-Hold | Resolved | Escalated
30
+ * - In-Progress/In-Review/On-Hold → (same level or Resolved/Escalated)
31
+ * - Resolved → Appealed | Closed | Unresolved
32
+ * - Appealed → Escalated | Resolved | Unresolved
33
+ * - Escalated → Resolved | Unresolved
34
+ * - Unresolved → Resolved
35
+ * - Resolved → Closed
36
+ * - Closed → Archived
37
+ * - Archived → [no transitions]
38
+ */
@@ -3,16 +3,42 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IncidentStatus = void 0;
4
4
  var IncidentStatus;
5
5
  (function (IncidentStatus) {
6
+ //Stage 1
6
7
  IncidentStatus["RECEIVED"] = "Received";
7
- IncidentStatus["PENDING"] = "Pending";
8
8
  IncidentStatus["IN_PROGRESS"] = "In-Progress";
9
+ IncidentStatus["IN_REVIEW"] = "In-Review";
9
10
  IncidentStatus["ON_HOLD"] = "On-Hold";
11
+ //Stage 2
10
12
  IncidentStatus["ESCALATED"] = "Escalated";
11
- IncidentStatus["IN_REVIEW"] = "In-Review";
12
13
  IncidentStatus["RESOLVED"] = "Resolved";
13
14
  IncidentStatus["APPEALED"] = "Appealed";
14
15
  IncidentStatus["CLOSED"] = "Closed";
15
16
  IncidentStatus["UNRESOLVED"] = "Unresolved";
16
- IncidentStatus["OVERDUE"] = "Overdue";
17
17
  IncidentStatus["ARCHIVED"] = "Archived";
18
18
  })(IncidentStatus || (exports.IncidentStatus = IncidentStatus = {}));
19
+ /**
20
+ * When an incident is first created it will be created in the DB with the default status Received.
21
+ * Thereafter it can be changed from status Received to any of the stage 1 statuses or Resolved or Escalated statuses in stage 2.
22
+ * An incident cannot change from any of the stage 1 statuses to status Appealed, Closed, Unresolved or Archived
23
+ * An incident CANNOT be changed back to status Received
24
+ * An incident with status Resolved can ONLY be changed to status Appealed, Closed or Unresolved
25
+ * An incident with status Appealed can ONLY be changed to status Escalated, Resolved or Unresolved
26
+ * An incident can ONLY be changed to status Appealed from status Resolved
27
+ * An incident with status Unresolved can only be changed to Resolved
28
+ * An incident with status Escalated can ONLY be changed to status Resolved or Unresolved
29
+ * An incident MUST first be changed to Resolved before status Closed
30
+ * Once an incident is Closed, it CANNOT be changed back to any other statuses apart from Archived
31
+ * An incident with status Archived CANNOT be changed to any other status
32
+ */
33
+ /**
34
+ * Transition map (simplified):
35
+ * - Received → In-Progress | In-Review | On-Hold | Resolved | Escalated
36
+ * - In-Progress/In-Review/On-Hold → (same level or Resolved/Escalated)
37
+ * - Resolved → Appealed | Closed | Unresolved
38
+ * - Appealed → Escalated | Resolved | Unresolved
39
+ * - Escalated → Resolved | Unresolved
40
+ * - Unresolved → Resolved
41
+ * - Resolved → Closed
42
+ * - Closed → Archived
43
+ * - Archived → [no transitions]
44
+ */
@@ -14,6 +14,9 @@ export * from './dtos/type/update-incident-type.dto';
14
14
  export * from './dtos/assignment/incident-assignment.dto';
15
15
  export * from './dtos/assignment/create-incident-assignment.dto';
16
16
  export * from './dtos/assignment/update-incident-assignment.dto';
17
+ export * from './dtos/response-unit-assignment/incident-response-unit-assignment.dto';
18
+ export * from './dtos/response-unit-assignment/create-incident-response-unit-assignment.dto';
19
+ export * from './dtos/response-unit-assignment/update-incident-response-unit-assignment.dto';
17
20
  export * from './enums/incident-app-id.enum';
18
21
  export * from './enums/incident-channel.enum';
19
22
  export * from './enums/incident-class.enum';
@@ -28,3 +31,4 @@ export * from './intefaces/incident-category';
28
31
  export * from './intefaces/incident-reporter';
29
32
  export * from './intefaces/incident-type';
30
33
  export * from './intefaces/incident-assignment';
34
+ export * from './intefaces/incident-response-unit-assignment';
@@ -31,6 +31,9 @@ __exportStar(require("./dtos/type/update-incident-type.dto"), exports);
31
31
  __exportStar(require("./dtos/assignment/incident-assignment.dto"), exports);
32
32
  __exportStar(require("./dtos/assignment/create-incident-assignment.dto"), exports);
33
33
  __exportStar(require("./dtos/assignment/update-incident-assignment.dto"), exports);
34
+ __exportStar(require("./dtos/response-unit-assignment/incident-response-unit-assignment.dto"), exports);
35
+ __exportStar(require("./dtos/response-unit-assignment/create-incident-response-unit-assignment.dto"), exports);
36
+ __exportStar(require("./dtos/response-unit-assignment/update-incident-response-unit-assignment.dto"), exports);
34
37
  //enums
35
38
  __exportStar(require("./enums/incident-app-id.enum"), exports);
36
39
  __exportStar(require("./enums/incident-channel.enum"), exports);
@@ -47,3 +50,4 @@ __exportStar(require("./intefaces/incident-category"), exports);
47
50
  __exportStar(require("./intefaces/incident-reporter"), exports);
48
51
  __exportStar(require("./intefaces/incident-type"), exports);
49
52
  __exportStar(require("./intefaces/incident-assignment"), exports);
53
+ __exportStar(require("./intefaces/incident-response-unit-assignment"), exports);
@@ -0,0 +1,8 @@
1
+ export interface IncidentResponseUnitAssignment {
2
+ id?: number;
3
+ incidentId: number;
4
+ assignedResponseUnitIds: number[];
5
+ assignerId: number;
6
+ comments: string;
7
+ timestamp: string;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,6 +9,7 @@ import { IncidentAction } from "./incident-action";
9
9
  import { IncidentAssignment } from "./incident-assignment";
10
10
  import { IncidentCategory } from "./incident-category";
11
11
  import { IncidentReporter } from "./incident-reporter";
12
+ import { IncidentResponseUnitAssignment } from "./incident-response-unit-assignment";
12
13
  import { IncidentType } from "./incident-type";
13
14
  export interface Incident {
14
15
  id?: number;
@@ -36,4 +37,5 @@ export interface Incident {
36
37
  type?: IncidentType;
37
38
  actions?: IncidentAction[];
38
39
  assignments?: IncidentAssignment[];
40
+ responseUnitAssignments?: IncidentResponseUnitAssignment[];
39
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grm-shared-library",
3
- "version": "1.0.182",
3
+ "version": "1.0.184",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [