grm-shared-library 1.0.124 → 1.0.126

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 (63) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +1 -0
  3. package/dist/kafka/client-ids.d.ts +2 -0
  4. package/dist/kafka/client-ids.js +3 -1
  5. package/dist/modules/common/dtos/map-address.dto.d.ts +1 -1
  6. package/dist/modules/common/dtos/map-address.dto.js +6 -0
  7. package/dist/modules/common/index.d.ts +4 -0
  8. package/dist/modules/common/index.js +4 -0
  9. package/dist/modules/common/interfaces/contact-person.d.ts +6 -0
  10. package/dist/modules/common/interfaces/contact-person.js +2 -0
  11. package/dist/modules/common/interfaces/map-address.d.ts +11 -0
  12. package/dist/modules/common/interfaces/map-address.js +2 -0
  13. package/dist/modules/common/interfaces/map-location.d.ts +5 -0
  14. package/dist/modules/common/interfaces/map-location.js +2 -0
  15. package/dist/modules/control-centre/interfaces/control-centre.d.ts +4 -5
  16. package/dist/modules/incident/dtos/action/incident-action.dto.d.ts +5 -0
  17. package/dist/modules/incident/dtos/action/incident-action.dto.js +31 -0
  18. package/dist/modules/incident/dtos/attachment/create-incident-attachment.dto.d.ts +7 -0
  19. package/dist/modules/incident/dtos/attachment/create-incident-attachment.dto.js +41 -0
  20. package/dist/modules/incident/dtos/attachment/update-incident-attachment.dto.d.ts +5 -0
  21. package/dist/modules/incident/dtos/attachment/update-incident-attachment.dto.js +8 -0
  22. package/dist/modules/incident/dtos/category/create-incident-category.dto.d.ts +4 -0
  23. package/dist/modules/incident/dtos/category/create-incident-category.dto.js +27 -0
  24. package/dist/modules/incident/dtos/category/update-incident-category.dto.d.ts +5 -0
  25. package/dist/modules/incident/dtos/category/update-incident-category.dto.js +8 -0
  26. package/dist/modules/incident/dtos/incident/create-incident.dto.d.ts +26 -0
  27. package/dist/modules/incident/dtos/incident/create-incident.dto.js +106 -0
  28. package/dist/modules/incident/dtos/incident/update-incident.dto.d.ts +5 -0
  29. package/dist/modules/incident/dtos/incident/update-incident.dto.js +8 -0
  30. package/dist/modules/incident/dtos/reporter/incident-reporter.dto.d.ts +5 -0
  31. package/dist/modules/incident/dtos/reporter/incident-reporter.dto.js +31 -0
  32. package/dist/modules/incident/dtos/type/create-incident-type.dto.d.ts +5 -0
  33. package/dist/modules/incident/dtos/type/create-incident-type.dto.js +32 -0
  34. package/dist/modules/incident/dtos/type/update-incident-type.dto.d.ts +5 -0
  35. package/dist/modules/incident/dtos/type/update-incident-type.dto.js +8 -0
  36. package/dist/modules/incident/enums/incident-app-id.enum.d.ts +5 -0
  37. package/dist/modules/incident/enums/incident-app-id.enum.js +9 -0
  38. package/dist/modules/incident/enums/incident-channel.enum.d.ts +11 -0
  39. package/dist/modules/incident/enums/incident-channel.enum.js +15 -0
  40. package/dist/modules/incident/enums/incident-class.enum.d.ts +4 -0
  41. package/dist/modules/incident/enums/incident-class.enum.js +8 -0
  42. package/dist/modules/incident/enums/incident-priority.enum.d.ts +6 -0
  43. package/dist/modules/incident/enums/incident-priority.enum.js +10 -0
  44. package/dist/modules/incident/index.d.ts +20 -0
  45. package/dist/modules/incident/index.js +39 -0
  46. package/dist/modules/incident/intefaces/incident-action.d.ts +5 -0
  47. package/dist/modules/incident/intefaces/incident-action.js +2 -0
  48. package/dist/modules/incident/intefaces/incident-attachment.d.ts +10 -0
  49. package/dist/modules/incident/intefaces/incident-attachment.js +2 -0
  50. package/dist/modules/incident/intefaces/incident-category.d.ts +5 -0
  51. package/dist/modules/incident/intefaces/incident-category.js +2 -0
  52. package/dist/modules/incident/intefaces/incident-reporter.d.ts +5 -0
  53. package/dist/modules/incident/intefaces/incident-reporter.js +2 -0
  54. package/dist/modules/incident/intefaces/incident-type.d.ts +6 -0
  55. package/dist/modules/incident/intefaces/incident-type.js +2 -0
  56. package/dist/modules/incident/intefaces/incident.d.ts +29 -0
  57. package/dist/modules/incident/intefaces/incident.js +2 -0
  58. package/dist/modules/organization/interfaces/organization.d.ts +4 -5
  59. package/dist/modules/response-unit/interfaces/response-unit/response-unit.d.ts +2 -5
  60. package/dist/modules/role/enums/role.enum.d.ts +2 -1
  61. package/dist/modules/role/enums/role.enum.js +1 -0
  62. package/dist/modules/user/interfaces/user.d.ts +3 -3
  63. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './modules/user/index';
7
7
  export * from './modules/control-centre/index';
8
8
  export * from './modules/email/index';
9
9
  export * from './modules/response-unit/index';
10
+ export * from './modules/incident/index';
10
11
  export * from './interfaces/server-message';
11
12
  export * from './kafka/index';
12
13
  export * from './decorators/case-decorators';
package/dist/index.js CHANGED
@@ -24,6 +24,7 @@ __exportStar(require("./modules/user/index"), exports);
24
24
  __exportStar(require("./modules/control-centre/index"), exports);
25
25
  __exportStar(require("./modules/email/index"), exports);
26
26
  __exportStar(require("./modules/response-unit/index"), exports);
27
+ __exportStar(require("./modules/incident/index"), exports);
27
28
  // Interfaces
28
29
  __exportStar(require("./interfaces/server-message"), exports);
29
30
  // Kafka
@@ -3,4 +3,6 @@ export declare const CLIENT_IDS: {
3
3
  AUTH_SERVICE: string;
4
4
  ORGANIZATION_SERVICE: string;
5
5
  EMAIL_SERVICE: string;
6
+ INCIDENT_SERVICE: string;
7
+ NOTIFICATION_SERVICE: string;
6
8
  };
@@ -5,5 +5,7 @@ exports.CLIENT_IDS = {
5
5
  API_GATEWAY: 'api-gateway',
6
6
  AUTH_SERVICE: 'auth-service',
7
7
  ORGANIZATION_SERVICE: 'organization-service',
8
- EMAIL_SERVICE: 'email-service'
8
+ EMAIL_SERVICE: 'email-service',
9
+ INCIDENT_SERVICE: 'incident-service',
10
+ NOTIFICATION_SERVICE: 'notification-service',
9
11
  };
@@ -4,7 +4,7 @@ export declare class MapAddressDto {
4
4
  physicalAddress: string;
5
5
  location: MapLocationDto;
6
6
  plusCode?: string;
7
- buildingName: string;
7
+ buildingName?: string;
8
8
  phone?: string;
9
9
  photo?: string;
10
10
  isValid?: boolean;
@@ -18,6 +18,7 @@ class MapAddressDto {
18
18
  exports.MapAddressDto = MapAddressDto;
19
19
  __decorate([
20
20
  (0, class_validator_1.IsString)(),
21
+ (0, class_validator_1.IsOptional)(),
21
22
  __metadata("design:type", String)
22
23
  ], MapAddressDto.prototype, "placeId", void 0);
23
24
  __decorate([
@@ -31,21 +32,26 @@ __decorate([
31
32
  ], MapAddressDto.prototype, "location", void 0);
32
33
  __decorate([
33
34
  (0, class_validator_1.IsString)(),
35
+ (0, class_validator_1.IsOptional)(),
34
36
  __metadata("design:type", String)
35
37
  ], MapAddressDto.prototype, "plusCode", void 0);
36
38
  __decorate([
37
39
  (0, class_validator_1.IsString)(),
40
+ (0, class_validator_1.IsOptional)(),
38
41
  __metadata("design:type", String)
39
42
  ], MapAddressDto.prototype, "buildingName", void 0);
40
43
  __decorate([
41
44
  (0, class_validator_1.IsString)(),
45
+ (0, class_validator_1.IsOptional)(),
42
46
  __metadata("design:type", String)
43
47
  ], MapAddressDto.prototype, "phone", void 0);
44
48
  __decorate([
45
49
  (0, class_validator_1.IsString)(),
50
+ (0, class_validator_1.IsOptional)(),
46
51
  __metadata("design:type", String)
47
52
  ], MapAddressDto.prototype, "photo", void 0);
48
53
  __decorate([
49
54
  (0, class_validator_1.IsBoolean)(),
55
+ (0, class_validator_1.IsOptional)(),
50
56
  __metadata("design:type", Boolean)
51
57
  ], MapAddressDto.prototype, "isValid", void 0);
@@ -1,2 +1,6 @@
1
1
  export * from './dtos/map-location.dto';
2
2
  export * from './dtos/map-address.dto';
3
+ export * from './dtos/contact-person.dto';
4
+ export * from './interfaces/map-location';
5
+ export * from './interfaces/map-address';
6
+ export * from './interfaces/contact-person';
@@ -16,3 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./dtos/map-location.dto"), exports);
18
18
  __exportStar(require("./dtos/map-address.dto"), exports);
19
+ __exportStar(require("./dtos/contact-person.dto"), exports);
20
+ __exportStar(require("./interfaces/map-location"), exports);
21
+ __exportStar(require("./interfaces/map-address"), exports);
22
+ __exportStar(require("./interfaces/contact-person"), exports);
@@ -0,0 +1,6 @@
1
+ export interface ContactPerson {
2
+ name: string;
3
+ phoneNumber: string;
4
+ email: string;
5
+ designation: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { MapLocation } from "./map-location";
2
+ export interface MapAddress {
3
+ placeId?: string;
4
+ physicalAddress: string;
5
+ location: MapLocation;
6
+ plusCode?: string;
7
+ buildingName?: string;
8
+ phone?: string;
9
+ photo?: string;
10
+ isValid?: boolean;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export interface MapLocation {
2
+ lat: number;
3
+ lng: number;
4
+ course?: number;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,14 +1,13 @@
1
- import { MapAddressDto } from "../../common";
2
- import { ContactPersonDto } from "../../common/dtos/contact-person.dto";
1
+ import { ContactPerson, MapAddress } from "../../common";
3
2
  export interface ControlCentre {
4
- id: number;
3
+ id?: number;
5
4
  name: string;
6
5
  phoneNumber?: string;
7
6
  email?: string;
8
- physicalAddress: MapAddressDto;
7
+ physicalAddress: MapAddress;
9
8
  status?: string;
10
9
  logo?: string;
11
- contactPerson: ContactPersonDto;
10
+ contactPerson: ContactPerson;
12
11
  attributes?: Record<string, any>;
13
12
  organizationId: number;
14
13
  createdAt?: Date;
@@ -0,0 +1,5 @@
1
+ export declare class IncidentActionDto {
2
+ action: string;
3
+ timestamp: Date;
4
+ userId: number;
5
+ }
@@ -0,0 +1,31 @@
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.IncidentActionDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class IncidentActionDto {
15
+ }
16
+ exports.IncidentActionDto = IncidentActionDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsString)(),
19
+ (0, class_validator_1.IsNotEmpty)(),
20
+ __metadata("design:type", String)
21
+ ], IncidentActionDto.prototype, "action", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsDateString)(),
24
+ (0, class_validator_1.IsNotEmpty)(),
25
+ __metadata("design:type", Date)
26
+ ], 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);
@@ -0,0 +1,7 @@
1
+ export declare class CreateIncidentAttachmentDto {
2
+ incidentId: number;
3
+ fileName: string;
4
+ fileType: string;
5
+ fileSize: number;
6
+ filePath: string;
7
+ }
@@ -0,0 +1,41 @@
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.CreateIncidentAttachmentDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class CreateIncidentAttachmentDto {
15
+ }
16
+ exports.CreateIncidentAttachmentDto = CreateIncidentAttachmentDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsNumber)(),
19
+ (0, class_validator_1.IsNotEmpty)(),
20
+ __metadata("design:type", Number)
21
+ ], CreateIncidentAttachmentDto.prototype, "incidentId", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsString)(),
24
+ (0, class_validator_1.IsNotEmpty)(),
25
+ __metadata("design:type", String)
26
+ ], CreateIncidentAttachmentDto.prototype, "fileName", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsString)(),
29
+ (0, class_validator_1.IsNotEmpty)(),
30
+ __metadata("design:type", String)
31
+ ], CreateIncidentAttachmentDto.prototype, "fileType", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsNumber)(),
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ __metadata("design:type", Number)
36
+ ], CreateIncidentAttachmentDto.prototype, "fileSize", void 0);
37
+ __decorate([
38
+ (0, class_validator_1.IsUrl)(),
39
+ (0, class_validator_1.IsNotEmpty)(),
40
+ __metadata("design:type", String)
41
+ ], CreateIncidentAttachmentDto.prototype, "filePath", void 0);
@@ -0,0 +1,5 @@
1
+ import { CreateIncidentAttachmentDto } from "./create-incident-attachment.dto";
2
+ declare const UpdateIncidentAttachmentDto_base: import("@nestjs/mapped-types").MappedType<Partial<CreateIncidentAttachmentDto>>;
3
+ export declare class UpdateIncidentAttachmentDto extends UpdateIncidentAttachmentDto_base {
4
+ }
5
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateIncidentAttachmentDto = void 0;
4
+ const mapped_types_1 = require("@nestjs/mapped-types");
5
+ const create_incident_attachment_dto_1 = require("./create-incident-attachment.dto");
6
+ class UpdateIncidentAttachmentDto extends (0, mapped_types_1.PartialType)(create_incident_attachment_dto_1.CreateIncidentAttachmentDto) {
7
+ }
8
+ exports.UpdateIncidentAttachmentDto = UpdateIncidentAttachmentDto;
@@ -0,0 +1,4 @@
1
+ export declare class CreateIncidentCategoryDto {
2
+ name: string;
3
+ description?: string;
4
+ }
@@ -0,0 +1,27 @@
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.CreateIncidentCategoryDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class CreateIncidentCategoryDto {
15
+ }
16
+ exports.CreateIncidentCategoryDto = CreateIncidentCategoryDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsString)(),
19
+ (0, class_validator_1.IsNotEmpty)(),
20
+ __metadata("design:type", String)
21
+ ], CreateIncidentCategoryDto.prototype, "name", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsString)(),
24
+ (0, class_validator_1.IsOptional)(),
25
+ (0, class_validator_1.MaxLength)(255),
26
+ __metadata("design:type", String)
27
+ ], CreateIncidentCategoryDto.prototype, "description", void 0);
@@ -0,0 +1,5 @@
1
+ import { CreateIncidentCategoryDto } from "./create-incident-category.dto";
2
+ declare const UpdateIncidentCategoryDto_base: import("@nestjs/mapped-types").MappedType<Partial<CreateIncidentCategoryDto>>;
3
+ export declare class UpdateIncidentCategoryDto extends UpdateIncidentCategoryDto_base {
4
+ }
5
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateIncidentCategoryDto = void 0;
4
+ const mapped_types_1 = require("@nestjs/mapped-types");
5
+ const create_incident_category_dto_1 = require("./create-incident-category.dto");
6
+ class UpdateIncidentCategoryDto extends (0, mapped_types_1.PartialType)(create_incident_category_dto_1.CreateIncidentCategoryDto) {
7
+ }
8
+ exports.UpdateIncidentCategoryDto = UpdateIncidentCategoryDto;
@@ -0,0 +1,26 @@
1
+ import { IncidentAppId } from "../../enums/incident-app-id.enum";
2
+ import { IncidentClass } from "../../enums/incident-class.enum";
3
+ import { IncidentChannel } from "../../enums/incident-channel.enum";
4
+ import { CreateIncidentCategoryDto } from "../category/create-incident-category.dto";
5
+ import { CreateIncidentTypeDto } from "../type/create-incident-type.dto";
6
+ import { IncidentActionDto } from "../action/incident-action.dto";
7
+ import { IncidentPriority } from "../../enums/incident-priority.enum";
8
+ import { MapLocationDto } from "../../../common";
9
+ import { IncidentReporterDto } from "../reporter/incident-reporter.dto";
10
+ export declare class CreateIncidentDto {
11
+ appId: IncidentAppId;
12
+ class: IncidentClass;
13
+ reporter: IncidentReporterDto;
14
+ userId?: number;
15
+ isAnonymous?: boolean;
16
+ channel: IncidentChannel;
17
+ category?: CreateIncidentCategoryDto;
18
+ type: CreateIncidentTypeDto;
19
+ description?: string;
20
+ status: string;
21
+ action: IncidentActionDto;
22
+ priority?: IncidentPriority;
23
+ location?: MapLocationDto;
24
+ controlCentreId: number;
25
+ organizationId: number;
26
+ }
@@ -0,0 +1,106 @@
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.CreateIncidentDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const incident_app_id_enum_1 = require("../../enums/incident-app-id.enum");
15
+ const incident_class_enum_1 = require("../../enums/incident-class.enum");
16
+ const incident_channel_enum_1 = require("../../enums/incident-channel.enum");
17
+ const create_incident_category_dto_1 = require("../category/create-incident-category.dto");
18
+ const class_transformer_1 = require("class-transformer");
19
+ const create_incident_type_dto_1 = require("../type/create-incident-type.dto");
20
+ const incident_action_dto_1 = require("../action/incident-action.dto");
21
+ const incident_priority_enum_1 = require("../../enums/incident-priority.enum");
22
+ const common_1 = require("../../../common");
23
+ const incident_reporter_dto_1 = require("../reporter/incident-reporter.dto");
24
+ class CreateIncidentDto {
25
+ }
26
+ exports.CreateIncidentDto = CreateIncidentDto;
27
+ __decorate([
28
+ (0, class_validator_1.IsEnum)(incident_app_id_enum_1.IncidentAppId),
29
+ (0, class_validator_1.IsNotEmpty)(),
30
+ __metadata("design:type", String)
31
+ ], CreateIncidentDto.prototype, "appId", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsEnum)(incident_class_enum_1.IncidentClass),
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ __metadata("design:type", String)
36
+ ], CreateIncidentDto.prototype, "class", void 0);
37
+ __decorate([
38
+ (0, class_validator_1.ValidateNested)(),
39
+ (0, class_transformer_1.Type)(() => incident_reporter_dto_1.IncidentReporterDto),
40
+ (0, class_validator_1.IsNotEmpty)(),
41
+ __metadata("design:type", incident_reporter_dto_1.IncidentReporterDto)
42
+ ], CreateIncidentDto.prototype, "reporter", void 0);
43
+ __decorate([
44
+ (0, class_validator_1.IsNumber)(),
45
+ (0, class_validator_1.IsOptional)(),
46
+ __metadata("design:type", Number)
47
+ ], CreateIncidentDto.prototype, "userId", void 0);
48
+ __decorate([
49
+ (0, class_validator_1.IsBoolean)(),
50
+ (0, class_validator_1.IsOptional)(),
51
+ __metadata("design:type", Boolean)
52
+ ], CreateIncidentDto.prototype, "isAnonymous", void 0);
53
+ __decorate([
54
+ (0, class_validator_1.IsEnum)(incident_channel_enum_1.IncidentChannel),
55
+ (0, class_validator_1.IsNotEmpty)(),
56
+ __metadata("design:type", String)
57
+ ], CreateIncidentDto.prototype, "channel", void 0);
58
+ __decorate([
59
+ (0, class_validator_1.ValidateNested)(),
60
+ (0, class_transformer_1.Type)(() => create_incident_category_dto_1.CreateIncidentCategoryDto),
61
+ (0, class_validator_1.IsOptional)(),
62
+ __metadata("design:type", create_incident_category_dto_1.CreateIncidentCategoryDto)
63
+ ], CreateIncidentDto.prototype, "category", void 0);
64
+ __decorate([
65
+ (0, class_validator_1.ValidateNested)(),
66
+ (0, class_transformer_1.Type)(() => create_incident_type_dto_1.CreateIncidentTypeDto),
67
+ (0, class_validator_1.IsNotEmpty)(),
68
+ __metadata("design:type", create_incident_type_dto_1.CreateIncidentTypeDto)
69
+ ], CreateIncidentDto.prototype, "type", void 0);
70
+ __decorate([
71
+ (0, class_validator_1.IsString)(),
72
+ (0, class_validator_1.IsOptional)(),
73
+ __metadata("design:type", String)
74
+ ], CreateIncidentDto.prototype, "description", void 0);
75
+ __decorate([
76
+ (0, class_validator_1.IsString)(),
77
+ (0, class_validator_1.IsNotEmpty)(),
78
+ __metadata("design:type", String)
79
+ ], CreateIncidentDto.prototype, "status", void 0);
80
+ __decorate([
81
+ (0, class_validator_1.ValidateNested)(),
82
+ (0, class_transformer_1.Type)(() => incident_action_dto_1.IncidentActionDto),
83
+ (0, class_validator_1.IsNotEmpty)(),
84
+ __metadata("design:type", incident_action_dto_1.IncidentActionDto)
85
+ ], CreateIncidentDto.prototype, "action", void 0);
86
+ __decorate([
87
+ (0, class_validator_1.IsEnum)(incident_priority_enum_1.IncidentPriority),
88
+ (0, class_validator_1.IsOptional)(),
89
+ __metadata("design:type", String)
90
+ ], CreateIncidentDto.prototype, "priority", void 0);
91
+ __decorate([
92
+ (0, class_validator_1.ValidateNested)(),
93
+ (0, class_transformer_1.Type)(() => common_1.MapLocationDto),
94
+ (0, class_validator_1.IsOptional)(),
95
+ __metadata("design:type", common_1.MapLocationDto)
96
+ ], CreateIncidentDto.prototype, "location", void 0);
97
+ __decorate([
98
+ (0, class_validator_1.IsNumber)(),
99
+ (0, class_validator_1.IsNotEmpty)(),
100
+ __metadata("design:type", Number)
101
+ ], CreateIncidentDto.prototype, "controlCentreId", void 0);
102
+ __decorate([
103
+ (0, class_validator_1.IsNumber)(),
104
+ (0, class_validator_1.IsNotEmpty)(),
105
+ __metadata("design:type", Number)
106
+ ], CreateIncidentDto.prototype, "organizationId", void 0);
@@ -0,0 +1,5 @@
1
+ import { CreateIncidentDto } from "./create-incident.dto";
2
+ declare const UpdateIncidentDto_base: import("@nestjs/mapped-types").MappedType<Partial<CreateIncidentDto>>;
3
+ export declare class UpdateIncidentDto extends UpdateIncidentDto_base {
4
+ }
5
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateIncidentDto = void 0;
4
+ const mapped_types_1 = require("@nestjs/mapped-types");
5
+ const create_incident_dto_1 = require("./create-incident.dto");
6
+ class UpdateIncidentDto extends (0, mapped_types_1.PartialType)(create_incident_dto_1.CreateIncidentDto) {
7
+ }
8
+ exports.UpdateIncidentDto = UpdateIncidentDto;
@@ -0,0 +1,5 @@
1
+ export declare class IncidentReporterDto {
2
+ name: string;
3
+ phoneNumber?: string;
4
+ email?: string;
5
+ }
@@ -0,0 +1,31 @@
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.IncidentReporterDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class IncidentReporterDto {
15
+ }
16
+ exports.IncidentReporterDto = IncidentReporterDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsString)(),
19
+ (0, class_validator_1.IsNotEmpty)(),
20
+ __metadata("design:type", String)
21
+ ], IncidentReporterDto.prototype, "name", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsPhoneNumber)(),
24
+ (0, class_validator_1.IsOptional)(),
25
+ __metadata("design:type", String)
26
+ ], IncidentReporterDto.prototype, "phoneNumber", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsEmail)(),
29
+ (0, class_validator_1.IsOptional)(),
30
+ __metadata("design:type", String)
31
+ ], IncidentReporterDto.prototype, "email", void 0);
@@ -0,0 +1,5 @@
1
+ export declare class CreateIncidentTypeDto {
2
+ name: string;
3
+ description?: string;
4
+ categoryId?: number;
5
+ }
@@ -0,0 +1,32 @@
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.CreateIncidentTypeDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class CreateIncidentTypeDto {
15
+ }
16
+ exports.CreateIncidentTypeDto = CreateIncidentTypeDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsString)(),
19
+ (0, class_validator_1.IsNotEmpty)(),
20
+ __metadata("design:type", String)
21
+ ], CreateIncidentTypeDto.prototype, "name", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsString)(),
24
+ (0, class_validator_1.IsOptional)(),
25
+ (0, class_validator_1.MaxLength)(255),
26
+ __metadata("design:type", String)
27
+ ], CreateIncidentTypeDto.prototype, "description", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsNumber)(),
30
+ (0, class_validator_1.IsOptional)(),
31
+ __metadata("design:type", Number)
32
+ ], CreateIncidentTypeDto.prototype, "categoryId", void 0);
@@ -0,0 +1,5 @@
1
+ import { CreateIncidentTypeDto } from "./create-incident-type.dto";
2
+ declare const UpdateIncidentTypeDto_base: import("@nestjs/mapped-types").MappedType<Partial<CreateIncidentTypeDto>>;
3
+ export declare class UpdateIncidentTypeDto extends UpdateIncidentTypeDto_base {
4
+ }
5
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateIncidentTypeDto = void 0;
4
+ const mapped_types_1 = require("@nestjs/mapped-types");
5
+ const create_incident_type_dto_1 = require("./create-incident-type.dto");
6
+ class UpdateIncidentTypeDto extends (0, mapped_types_1.PartialType)(create_incident_type_dto_1.CreateIncidentTypeDto) {
7
+ }
8
+ exports.UpdateIncidentTypeDto = UpdateIncidentTypeDto;
@@ -0,0 +1,5 @@
1
+ export declare enum IncidentAppId {
2
+ UPESY = "Upesy",
3
+ GRM = "GRM",
4
+ PASHA = "Pasha"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IncidentAppId = void 0;
4
+ var IncidentAppId;
5
+ (function (IncidentAppId) {
6
+ IncidentAppId["UPESY"] = "Upesy";
7
+ IncidentAppId["GRM"] = "GRM";
8
+ IncidentAppId["PASHA"] = "Pasha";
9
+ })(IncidentAppId || (exports.IncidentAppId = IncidentAppId = {}));
@@ -0,0 +1,11 @@
1
+ export declare enum IncidentChannel {
2
+ APP = "App",
3
+ WEB = "Web",
4
+ EMAIL = "Email",
5
+ SMS = "SMS",
6
+ PHONE = "Phone",
7
+ CHAT = "Chat",
8
+ SOCIAL_MEDIA = "Social Media",
9
+ IN_PERSON = "In Person",
10
+ OTHER = "Other"
11
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IncidentChannel = void 0;
4
+ var IncidentChannel;
5
+ (function (IncidentChannel) {
6
+ IncidentChannel["APP"] = "App";
7
+ IncidentChannel["WEB"] = "Web";
8
+ IncidentChannel["EMAIL"] = "Email";
9
+ IncidentChannel["SMS"] = "SMS";
10
+ IncidentChannel["PHONE"] = "Phone";
11
+ IncidentChannel["CHAT"] = "Chat";
12
+ IncidentChannel["SOCIAL_MEDIA"] = "Social Media";
13
+ IncidentChannel["IN_PERSON"] = "In Person";
14
+ IncidentChannel["OTHER"] = "Other";
15
+ })(IncidentChannel || (exports.IncidentChannel = IncidentChannel = {}));
@@ -0,0 +1,4 @@
1
+ export declare enum IncidentClass {
2
+ INCIDENT = "Incident",
3
+ GRIEVANCE = "Grievance"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IncidentClass = void 0;
4
+ var IncidentClass;
5
+ (function (IncidentClass) {
6
+ IncidentClass["INCIDENT"] = "Incident";
7
+ IncidentClass["GRIEVANCE"] = "Grievance";
8
+ })(IncidentClass || (exports.IncidentClass = IncidentClass = {}));
@@ -0,0 +1,6 @@
1
+ export declare enum IncidentPriority {
2
+ LOW = "low",
3
+ MEDIUM = "medium",
4
+ HIGH = "high",
5
+ CRITICAL = "critical"
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IncidentPriority = void 0;
4
+ var IncidentPriority;
5
+ (function (IncidentPriority) {
6
+ IncidentPriority["LOW"] = "low";
7
+ IncidentPriority["MEDIUM"] = "medium";
8
+ IncidentPriority["HIGH"] = "high";
9
+ IncidentPriority["CRITICAL"] = "critical";
10
+ })(IncidentPriority || (exports.IncidentPriority = IncidentPriority = {}));
@@ -0,0 +1,20 @@
1
+ export * from './dtos/action/incident-action.dto';
2
+ export * from './dtos/attachment/create-incident-attachment.dto';
3
+ export * from './dtos/attachment/update-incident-attachment.dto';
4
+ export * from './dtos/category/create-incident-category.dto';
5
+ export * from './dtos/category/update-incident-category.dto';
6
+ export * from './dtos/incident/create-incident.dto';
7
+ export * from './dtos/incident/update-incident.dto';
8
+ export * from './dtos/reporter/incident-reporter.dto';
9
+ export * from './dtos/type/create-incident-type.dto';
10
+ export * from './dtos/type/update-incident-type.dto';
11
+ export * from './enums/incident-app-id.enum';
12
+ export * from './enums/incident-channel.enum';
13
+ export * from './enums/incident-class.enum';
14
+ export * from './enums/incident-priority.enum';
15
+ export * from './intefaces/incident';
16
+ export * from './intefaces/incident-action';
17
+ export * from './intefaces/incident-attachment';
18
+ export * from './intefaces/incident-category';
19
+ export * from './intefaces/incident-reporter';
20
+ export * from './intefaces/incident-type';
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Dtos
18
+ __exportStar(require("./dtos/action/incident-action.dto"), exports);
19
+ __exportStar(require("./dtos/attachment/create-incident-attachment.dto"), exports);
20
+ __exportStar(require("./dtos/attachment/update-incident-attachment.dto"), exports);
21
+ __exportStar(require("./dtos/category/create-incident-category.dto"), exports);
22
+ __exportStar(require("./dtos/category/update-incident-category.dto"), exports);
23
+ __exportStar(require("./dtos/incident/create-incident.dto"), exports);
24
+ __exportStar(require("./dtos/incident/update-incident.dto"), exports);
25
+ __exportStar(require("./dtos/reporter/incident-reporter.dto"), exports);
26
+ __exportStar(require("./dtos/type/create-incident-type.dto"), exports);
27
+ __exportStar(require("./dtos/type/update-incident-type.dto"), exports);
28
+ //enums
29
+ __exportStar(require("./enums/incident-app-id.enum"), exports);
30
+ __exportStar(require("./enums/incident-channel.enum"), exports);
31
+ __exportStar(require("./enums/incident-class.enum"), exports);
32
+ __exportStar(require("./enums/incident-priority.enum"), exports);
33
+ //Interfaces
34
+ __exportStar(require("./intefaces/incident"), exports);
35
+ __exportStar(require("./intefaces/incident-action"), exports);
36
+ __exportStar(require("./intefaces/incident-attachment"), exports);
37
+ __exportStar(require("./intefaces/incident-category"), exports);
38
+ __exportStar(require("./intefaces/incident-reporter"), exports);
39
+ __exportStar(require("./intefaces/incident-type"), exports);
@@ -0,0 +1,5 @@
1
+ export interface IncidentAction {
2
+ action: string;
3
+ timestamp: Date;
4
+ userId: number;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ export interface IncidentAttachment {
2
+ id?: number;
3
+ incidentId: number;
4
+ fileName: string;
5
+ fileType: string;
6
+ fileSize: number;
7
+ filePath: string;
8
+ createdAt?: Date;
9
+ updatedAt?: Date;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export interface IncidentCategory {
2
+ id?: number;
3
+ name: string;
4
+ description?: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export interface IncidentReporter {
2
+ name: string;
3
+ phoneNumber?: string;
4
+ email?: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export interface IncidentType {
2
+ id?: number;
3
+ name: string;
4
+ description?: string;
5
+ categoryId?: number;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,29 @@
1
+ import { MapLocation } from "../../common/interfaces/map-location";
2
+ import { IncidentAppId } from "../enums/incident-app-id.enum";
3
+ import { IncidentChannel } from "../enums/incident-channel.enum";
4
+ import { IncidentClass } from "../enums/incident-class.enum";
5
+ import { IncidentPriority } from "../enums/incident-priority.enum";
6
+ import { IncidentAction } from "./incident-action";
7
+ import { IncidentCategory } from "./incident-category";
8
+ import { IncidentReporter } from "./incident-reporter";
9
+ import { IncidentType } from "./incident-type";
10
+ export interface Incident {
11
+ id?: number;
12
+ appId: IncidentAppId;
13
+ class: IncidentClass;
14
+ reporter?: IncidentReporter;
15
+ userId?: number;
16
+ isAnonymous?: boolean;
17
+ channel: IncidentChannel;
18
+ category?: IncidentCategory;
19
+ type: IncidentType;
20
+ description?: string;
21
+ status: string;
22
+ action: IncidentAction;
23
+ priority?: IncidentPriority;
24
+ location?: MapLocation;
25
+ controlCentreId: number;
26
+ organizationId: number;
27
+ createdAt?: Date;
28
+ updatedAt?: Date;
29
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,18 +1,17 @@
1
- import { ContactPersonDto } from "../../common/dtos/contact-person.dto";
2
- import { MapAddressDto } from "../../common/dtos/map-address.dto";
1
+ import { ContactPerson, MapAddress } from "../../common";
3
2
  import { OrganizationType } from "../enums/org-type.enum";
4
3
  export interface Organization {
5
- id: number;
4
+ id?: number;
6
5
  name: string;
7
6
  phoneNumber?: string;
8
7
  email?: string;
9
- physicalAddress: MapAddressDto;
8
+ physicalAddress: MapAddress;
10
9
  website: string;
11
10
  type: OrganizationType;
12
11
  description?: string;
13
12
  status?: string;
14
13
  logo?: string;
15
- contactPerson: ContactPersonDto;
14
+ contactPerson: ContactPerson;
16
15
  createdAt?: Date;
17
16
  updatedAt?: Date;
18
17
  }
@@ -1,4 +1,4 @@
1
- import { MapAddressDto } from "../../../common";
1
+ import { MapAddressDto, MapLocation } from "../../../common";
2
2
  import { ResponseUnitType } from "../../enums/response-unit/response-unit-type.enum";
3
3
  export interface ResponseUnit {
4
4
  id: number;
@@ -6,10 +6,7 @@ export interface ResponseUnit {
6
6
  description?: string;
7
7
  type: ResponseUnitType;
8
8
  isActive: boolean;
9
- location: {
10
- lat: number;
11
- lng: number;
12
- };
9
+ location: MapLocation;
13
10
  station: {
14
11
  name: string;
15
12
  address: MapAddressDto;
@@ -4,5 +4,6 @@ export declare enum Roles {
4
4
  ORGANIZATION_ADMIN = "Org:Admin",
5
5
  ORGANIZATION_USER = "Org:User",
6
6
  CONTROL_CENTRE_ADMIN = "Control-Centre:Admin",
7
- CONTROL_CENTRE_USER = "Control-Centre:User"
7
+ CONTROL_CENTRE_USER = "Control-Centre:User",
8
+ MOBILE_USER = "Mobile-User"
8
9
  }
@@ -9,4 +9,5 @@ var Roles;
9
9
  Roles["ORGANIZATION_USER"] = "Org:User";
10
10
  Roles["CONTROL_CENTRE_ADMIN"] = "Control-Centre:Admin";
11
11
  Roles["CONTROL_CENTRE_USER"] = "Control-Centre:User";
12
+ Roles["MOBILE_USER"] = "Mobile-User";
12
13
  })(Roles || (exports.Roles = Roles = {}));
@@ -2,7 +2,7 @@ import { ControlCentre } from "../../control-centre";
2
2
  import { Organization } from "../../organization";
3
3
  import { Roles } from "../../role";
4
4
  export interface User {
5
- id: number;
5
+ id?: number;
6
6
  name: string;
7
7
  email: string;
8
8
  phoneNumber?: string;
@@ -18,8 +18,8 @@ export interface User {
18
18
  verificationToken?: string;
19
19
  verificationTokenExpiresAt?: Date;
20
20
  lastLoginAt?: Date;
21
- controlCentre?: ControlCentre;
22
- organization: Organization;
21
+ controlCentreId?: ControlCentre;
22
+ organizationId: Organization;
23
23
  createdAt?: Date;
24
24
  updatedAt?: Date;
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grm-shared-library",
3
- "version": "1.0.124",
3
+ "version": "1.0.126",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [