@platform-modules/civil-aviation-authority 2.0.1 → 2.0.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.
@@ -31,6 +31,8 @@ const contactInfoModel_1 = require("./models/contactInfoModel");
31
31
  const userRolesModel_1 = require("./models/userRolesModel");
32
32
  const roleRightsModel_1 = require("./models/roleRightsModel");
33
33
  const NotificationModel_1 = require("./models/NotificationModel");
34
+ const ITRequestChatModel_1 = require("./models/ITRequestChatModel");
35
+ const ITRequestAttachmentModel_1 = require("./models/ITRequestAttachmentModel");
34
36
  exports.AppDataSource = new typeorm_1.DataSource({
35
37
  type: 'postgres',
36
38
  host: process.env.DB_HOST || 'localhost',
@@ -65,6 +67,8 @@ exports.AppDataSource = new typeorm_1.DataSource({
65
67
  contactInfoModel_1.ContactInfo,
66
68
  userRolesModel_1.UserRole,
67
69
  roleRightsModel_1.RoleRights,
68
- NotificationModel_1.Notification
70
+ NotificationModel_1.Notification,
71
+ ITRequestChatModel_1.ITRequestChat,
72
+ ITRequestAttachmentModel_1.ITRequestAttachment
69
73
  ],
70
74
  });
package/dist/index.d.ts CHANGED
@@ -23,3 +23,5 @@ export * from './models/contactInfoModel';
23
23
  export * from './models/userRolesModel';
24
24
  export * from './models/roleRightsModel';
25
25
  export * from './models/NotificationModel';
26
+ export * from './models/ITRequestChatModel';
27
+ export * from './models/ITRequestAttachmentModel';
package/dist/index.js CHANGED
@@ -40,3 +40,5 @@ __exportStar(require("./models/contactInfoModel"), exports);
40
40
  __exportStar(require("./models/userRolesModel"), exports);
41
41
  __exportStar(require("./models/roleRightsModel"), exports);
42
42
  __exportStar(require("./models/NotificationModel"), exports);
43
+ __exportStar(require("./models/ITRequestChatModel"), exports);
44
+ __exportStar(require("./models/ITRequestAttachmentModel"), exports);
@@ -3,6 +3,5 @@ export declare class CAAServices extends BaseModel {
3
3
  code: string;
4
4
  name: string;
5
5
  description: string;
6
- logo_url: string;
7
- constructor(name: string, description: string, logo_url: string, code?: string);
6
+ constructor(name: string, description: string, code?: string);
8
7
  }
@@ -13,11 +13,10 @@ exports.CAAServices = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const BaseModel_1 = require("./BaseModel");
15
15
  let CAAServices = class CAAServices extends BaseModel_1.BaseModel {
16
- constructor(name, description, logo_url, code) {
16
+ constructor(name, description, code) {
17
17
  super();
18
18
  this.name = name;
19
19
  this.description = description;
20
- this.logo_url = logo_url;
21
20
  this.code = code || '';
22
21
  }
23
22
  };
@@ -34,11 +33,7 @@ __decorate([
34
33
  (0, typeorm_1.Column)({ nullable: false }),
35
34
  __metadata("design:type", String)
36
35
  ], CAAServices.prototype, "description", void 0);
37
- __decorate([
38
- (0, typeorm_1.Column)({ nullable: false }),
39
- __metadata("design:type", String)
40
- ], CAAServices.prototype, "logo_url", void 0);
41
36
  exports.CAAServices = CAAServices = __decorate([
42
37
  (0, typeorm_1.Entity)({ name: 'caa_services' }),
43
- __metadata("design:paramtypes", [String, String, String, String])
38
+ __metadata("design:paramtypes", [String, String, String])
44
39
  ], CAAServices);
@@ -0,0 +1,15 @@
1
+ import { BaseModel } from './BaseModel';
2
+ import { ITHelpDeskRequests } from './ITHelpDeskModel';
3
+ import { User } from './user';
4
+ export declare class ITRequestAttachment extends BaseModel {
5
+ request_id: number;
6
+ request: ITHelpDeskRequests;
7
+ uploaded_by: number;
8
+ user: User;
9
+ file_url: string;
10
+ file_name: string;
11
+ file_type: string;
12
+ file_size: number | null;
13
+ description: string;
14
+ constructor(request_id: number, uploaded_by: number, file_url: string, file_name?: string, file_type?: string, file_size?: number, description?: string);
15
+ }
@@ -0,0 +1,71 @@
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.ITRequestAttachment = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ const ITHelpDeskModel_1 = require("./ITHelpDeskModel");
16
+ const user_1 = require("./user");
17
+ let ITRequestAttachment = class ITRequestAttachment extends BaseModel_1.BaseModel {
18
+ constructor(request_id, uploaded_by, file_url, file_name, file_type, file_size, description) {
19
+ super();
20
+ this.request_id = request_id;
21
+ this.uploaded_by = uploaded_by;
22
+ this.file_url = file_url;
23
+ this.file_name = file_name || '';
24
+ this.file_type = file_type || '';
25
+ this.file_size = file_size || null;
26
+ this.description = description || '';
27
+ }
28
+ };
29
+ exports.ITRequestAttachment = ITRequestAttachment;
30
+ __decorate([
31
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
32
+ __metadata("design:type", Number)
33
+ ], ITRequestAttachment.prototype, "request_id", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.ManyToOne)(() => ITHelpDeskModel_1.ITHelpDeskRequests),
36
+ (0, typeorm_1.JoinColumn)({ name: 'request_id' }),
37
+ __metadata("design:type", ITHelpDeskModel_1.ITHelpDeskRequests)
38
+ ], ITRequestAttachment.prototype, "request", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
41
+ __metadata("design:type", Number)
42
+ ], ITRequestAttachment.prototype, "uploaded_by", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.ManyToOne)(() => user_1.User),
45
+ (0, typeorm_1.JoinColumn)({ name: 'uploaded_by' }),
46
+ __metadata("design:type", user_1.User)
47
+ ], ITRequestAttachment.prototype, "user", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: false }),
50
+ __metadata("design:type", String)
51
+ ], ITRequestAttachment.prototype, "file_url", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
54
+ __metadata("design:type", String)
55
+ ], ITRequestAttachment.prototype, "file_name", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
58
+ __metadata("design:type", String)
59
+ ], ITRequestAttachment.prototype, "file_type", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
62
+ __metadata("design:type", Object)
63
+ ], ITRequestAttachment.prototype, "file_size", void 0);
64
+ __decorate([
65
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
66
+ __metadata("design:type", String)
67
+ ], ITRequestAttachment.prototype, "description", void 0);
68
+ exports.ITRequestAttachment = ITRequestAttachment = __decorate([
69
+ (0, typeorm_1.Entity)({ name: 'it_request_attachments' }),
70
+ __metadata("design:paramtypes", [Number, Number, String, String, String, Number, String])
71
+ ], ITRequestAttachment);
@@ -0,0 +1,12 @@
1
+ import { BaseModel } from './BaseModel';
2
+ import { ITHelpDeskRequests } from './ITHelpDeskModel';
3
+ import { User } from './user';
4
+ export declare class ITRequestChat extends BaseModel {
5
+ request_id: number;
6
+ request: ITHelpDeskRequests;
7
+ user_id: number;
8
+ user: User;
9
+ message: string;
10
+ is_internal: boolean;
11
+ constructor(request_id: number, user_id: number, message: string, is_internal?: boolean);
12
+ }
@@ -0,0 +1,56 @@
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.ITRequestChat = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ const ITHelpDeskModel_1 = require("./ITHelpDeskModel");
16
+ const user_1 = require("./user");
17
+ let ITRequestChat = class ITRequestChat extends BaseModel_1.BaseModel {
18
+ constructor(request_id, user_id, message, is_internal) {
19
+ super();
20
+ this.request_id = request_id;
21
+ this.user_id = user_id;
22
+ this.message = message;
23
+ this.is_internal = is_internal || false;
24
+ }
25
+ };
26
+ exports.ITRequestChat = ITRequestChat;
27
+ __decorate([
28
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
29
+ __metadata("design:type", Number)
30
+ ], ITRequestChat.prototype, "request_id", void 0);
31
+ __decorate([
32
+ (0, typeorm_1.ManyToOne)(() => ITHelpDeskModel_1.ITHelpDeskRequests),
33
+ (0, typeorm_1.JoinColumn)({ name: 'request_id' }),
34
+ __metadata("design:type", ITHelpDeskModel_1.ITHelpDeskRequests)
35
+ ], ITRequestChat.prototype, "request", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
38
+ __metadata("design:type", Number)
39
+ ], ITRequestChat.prototype, "user_id", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.ManyToOne)(() => user_1.User),
42
+ (0, typeorm_1.JoinColumn)({ name: 'user_id' }),
43
+ __metadata("design:type", user_1.User)
44
+ ], ITRequestChat.prototype, "user", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({ type: 'text', nullable: false }),
47
+ __metadata("design:type", String)
48
+ ], ITRequestChat.prototype, "message", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({ type: 'boolean', default: false }),
51
+ __metadata("design:type", Boolean)
52
+ ], ITRequestChat.prototype, "is_internal", void 0);
53
+ exports.ITRequestChat = ITRequestChat = __decorate([
54
+ (0, typeorm_1.Entity)({ name: 'it_request_chat' }),
55
+ __metadata("design:paramtypes", [Number, Number, String, Boolean])
56
+ ], ITRequestChat);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/civil-aviation-authority",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -28,6 +28,8 @@ import { ContactInfo } from './models/contactInfoModel';
28
28
  import { UserRole } from './models/userRolesModel';
29
29
  import { RoleRights } from './models/roleRightsModel';
30
30
  import { Notification } from './models/NotificationModel';
31
+ import { ITRequestChat } from './models/ITRequestChatModel';
32
+ import { ITRequestAttachment } from './models/ITRequestAttachmentModel';
31
33
 
32
34
 
33
35
 
@@ -65,6 +67,8 @@ export const AppDataSource = new DataSource({
65
67
  ContactInfo,
66
68
  UserRole,
67
69
  RoleRights,
68
- Notification
70
+ Notification,
71
+ ITRequestChat,
72
+ ITRequestAttachment
69
73
  ],
70
74
  });
package/src/index.ts CHANGED
@@ -24,3 +24,5 @@ export * from './models/contactInfoModel';
24
24
  export * from './models/userRolesModel';
25
25
  export * from './models/roleRightsModel';
26
26
  export * from './models/NotificationModel';
27
+ export * from './models/ITRequestChatModel';
28
+ export * from './models/ITRequestAttachmentModel';
@@ -0,0 +1,57 @@
1
+ import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+ import { ITHelpDeskRequests } from './ITHelpDeskModel';
4
+ import { User } from './user';
5
+
6
+ @Entity({ name: 'it_request_attachments' })
7
+ export class ITRequestAttachment extends BaseModel {
8
+
9
+ @Column({ type: 'integer', nullable: false })
10
+ request_id: number;
11
+
12
+ @ManyToOne(() => ITHelpDeskRequests)
13
+ @JoinColumn({ name: 'request_id' })
14
+ request: ITHelpDeskRequests;
15
+
16
+ @Column({ type: 'integer', nullable: false })
17
+ uploaded_by: number;
18
+
19
+ @ManyToOne(() => User)
20
+ @JoinColumn({ name: 'uploaded_by' })
21
+ user: User;
22
+
23
+ @Column({ type: 'varchar', length: 500, nullable: false })
24
+ file_url: string;
25
+
26
+ @Column({ type: 'varchar', length: 255, nullable: true })
27
+ file_name: string;
28
+
29
+ @Column({ type: 'varchar', length: 100, nullable: true })
30
+ file_type: string;
31
+
32
+ @Column({ type: 'bigint', nullable: true })
33
+ file_size: number | null;
34
+
35
+ @Column({ type: 'text', nullable: true })
36
+ description: string;
37
+
38
+ constructor(
39
+ request_id: number,
40
+ uploaded_by: number,
41
+ file_url: string,
42
+ file_name?: string,
43
+ file_type?: string,
44
+ file_size?: number,
45
+ description?: string
46
+ ) {
47
+ super();
48
+ this.request_id = request_id;
49
+ this.uploaded_by = uploaded_by;
50
+ this.file_url = file_url;
51
+ this.file_name = file_name || '';
52
+ this.file_type = file_type || '';
53
+ this.file_size = file_size || null;
54
+ this.description = description || '';
55
+ }
56
+ }
57
+
@@ -0,0 +1,42 @@
1
+ import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+ import { ITHelpDeskRequests } from './ITHelpDeskModel';
4
+ import { User } from './user';
5
+
6
+ @Entity({ name: 'it_request_chat' })
7
+ export class ITRequestChat extends BaseModel {
8
+
9
+ @Column({ type: 'integer', nullable: false })
10
+ request_id: number;
11
+
12
+ @ManyToOne(() => ITHelpDeskRequests)
13
+ @JoinColumn({ name: 'request_id' })
14
+ request: ITHelpDeskRequests;
15
+
16
+ @Column({ type: 'integer', nullable: false })
17
+ user_id: number;
18
+
19
+ @ManyToOne(() => User)
20
+ @JoinColumn({ name: 'user_id' })
21
+ user: User;
22
+
23
+ @Column({ type: 'text', nullable: false })
24
+ message: string;
25
+
26
+ @Column({ type: 'boolean', default: false })
27
+ is_internal: boolean;
28
+
29
+ constructor(
30
+ request_id: number,
31
+ user_id: number,
32
+ message: string,
33
+ is_internal?: boolean
34
+ ) {
35
+ super();
36
+ this.request_id = request_id;
37
+ this.user_id = user_id;
38
+ this.message = message;
39
+ this.is_internal = is_internal || false;
40
+ }
41
+ }
42
+