@platform-modules/civil-aviation-authority 2.0.35 → 2.0.36
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.
- package/dist/data-source.js +9 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/models/ItApprovalsModel.d.ts +0 -1
- package/dist/models/ItApprovalsModel.js +0 -1
- package/dist/models/VpnApprovalModel.d.ts +19 -0
- package/dist/models/VpnApprovalModel.js +81 -0
- package/dist/models/VpnRequestAttachmentModel.d.ts +11 -0
- package/dist/models/VpnRequestAttachmentModel.js +59 -0
- package/dist/models/VpnRequestChatModel.d.ts +16 -0
- package/dist/models/VpnRequestChatModel.js +62 -0
- package/dist/models/VpnWorkflowModel.d.ts +13 -0
- package/dist/models/VpnWorkflowModel.js +55 -0
- package/package.json +1 -1
- package/src/data-source.ts +9 -1
- package/src/index.ts +4 -0
- package/src/models/ItApprovalsModel.ts +0 -1
- package/src/models/VpnApprovalModel.ts +69 -0
- package/src/models/VpnRequestAttachmentModel.ts +47 -0
- package/src/models/VpnRequestChatModel.ts +50 -0
- package/src/models/VpnWorkflowModel.ts +43 -0
package/dist/data-source.js
CHANGED
|
@@ -45,6 +45,10 @@ const DelegateSettingsModel_1 = require("./models/DelegateSettingsModel");
|
|
|
45
45
|
const feedbackModel_1 = require("./models/feedbackModel");
|
|
46
46
|
const PortalFeedbackModel_1 = require("./models/PortalFeedbackModel");
|
|
47
47
|
const VpnRequestModel_1 = require("./models/VpnRequestModel");
|
|
48
|
+
const VpnApprovalModel_1 = require("./models/VpnApprovalModel");
|
|
49
|
+
const VpnWorkflowModel_1 = require("./models/VpnWorkflowModel");
|
|
50
|
+
const VpnRequestAttachmentModel_1 = require("./models/VpnRequestAttachmentModel");
|
|
51
|
+
const VpnRequestChatModel_1 = require("./models/VpnRequestChatModel");
|
|
48
52
|
exports.AppDataSource = new typeorm_1.DataSource({
|
|
49
53
|
type: 'postgres',
|
|
50
54
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -93,6 +97,10 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
93
97
|
DelegateSettingsModel_1.DelegateSettings,
|
|
94
98
|
feedbackModel_1.Feedback,
|
|
95
99
|
PortalFeedbackModel_1.PortalFeedback,
|
|
96
|
-
VpnRequestModel_1.VpnRequest
|
|
100
|
+
VpnRequestModel_1.VpnRequest,
|
|
101
|
+
VpnApprovalModel_1.VpnApprovalDetails,
|
|
102
|
+
VpnWorkflowModel_1.VpnWorkFlow,
|
|
103
|
+
VpnRequestAttachmentModel_1.VpnRequestAttachment,
|
|
104
|
+
VpnRequestChatModel_1.VpnRequestChat
|
|
97
105
|
],
|
|
98
106
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -34,3 +34,7 @@ export * from './models/DelegateSettingsModel';
|
|
|
34
34
|
export * from './models/feedbackModel';
|
|
35
35
|
export * from './models/PortalFeedbackModel';
|
|
36
36
|
export * from './models/VpnRequestModel';
|
|
37
|
+
export * from './models/VpnApprovalModel';
|
|
38
|
+
export * from './models/VpnWorkflowModel';
|
|
39
|
+
export * from './models/VpnRequestChatModel';
|
|
40
|
+
export * from './models/VpnRequestAttachmentModel';
|
package/dist/index.js
CHANGED
|
@@ -54,3 +54,7 @@ __exportStar(require("./models/DelegateSettingsModel"), exports);
|
|
|
54
54
|
__exportStar(require("./models/feedbackModel"), exports);
|
|
55
55
|
__exportStar(require("./models/PortalFeedbackModel"), exports);
|
|
56
56
|
__exportStar(require("./models/VpnRequestModel"), exports);
|
|
57
|
+
__exportStar(require("./models/VpnApprovalModel"), exports);
|
|
58
|
+
__exportStar(require("./models/VpnWorkflowModel"), exports);
|
|
59
|
+
__exportStar(require("./models/VpnRequestChatModel"), exports);
|
|
60
|
+
__exportStar(require("./models/VpnRequestAttachmentModel"), exports);
|
|
@@ -15,7 +15,6 @@ const BaseModel_1 = require("./BaseModel");
|
|
|
15
15
|
var ApprovalStatus;
|
|
16
16
|
(function (ApprovalStatus) {
|
|
17
17
|
ApprovalStatus["PENDING"] = "Pending";
|
|
18
|
-
ApprovalStatus["IN_PROGRESS"] = "In Progress";
|
|
19
18
|
ApprovalStatus["APPROVED"] = "Approved";
|
|
20
19
|
ApprovalStatus["REJECTED"] = "Rejected";
|
|
21
20
|
})(ApprovalStatus || (exports.ApprovalStatus = ApprovalStatus = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseModel } from "./BaseModel";
|
|
2
|
+
export declare enum VpnApprovalStatus {
|
|
3
|
+
PENDING = "Pending",
|
|
4
|
+
IN_PROGRESS = "In Progress",
|
|
5
|
+
APPROVED = "Approved",
|
|
6
|
+
REJECTED = "Rejected"
|
|
7
|
+
}
|
|
8
|
+
export declare class VpnApprovalDetails extends BaseModel {
|
|
9
|
+
request_id: number;
|
|
10
|
+
level: number;
|
|
11
|
+
approver_user_id: number | null;
|
|
12
|
+
approver_role_id: number | null;
|
|
13
|
+
department_id: number | null;
|
|
14
|
+
section_id: number | null;
|
|
15
|
+
approved_by: number | null;
|
|
16
|
+
comment: string;
|
|
17
|
+
approval_status: VpnApprovalStatus;
|
|
18
|
+
constructor(request_id: number, approver_user_id: number | null, approver_role_id: number | null, comment: string, approval_status: VpnApprovalStatus, level: number, department_id?: number | null, section_id?: number | null, approved_by?: number | null);
|
|
19
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
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.VpnApprovalDetails = exports.VpnApprovalStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var VpnApprovalStatus;
|
|
16
|
+
(function (VpnApprovalStatus) {
|
|
17
|
+
VpnApprovalStatus["PENDING"] = "Pending";
|
|
18
|
+
VpnApprovalStatus["IN_PROGRESS"] = "In Progress";
|
|
19
|
+
VpnApprovalStatus["APPROVED"] = "Approved";
|
|
20
|
+
VpnApprovalStatus["REJECTED"] = "Rejected";
|
|
21
|
+
})(VpnApprovalStatus || (exports.VpnApprovalStatus = VpnApprovalStatus = {}));
|
|
22
|
+
let VpnApprovalDetails = class VpnApprovalDetails extends BaseModel_1.BaseModel {
|
|
23
|
+
constructor(request_id, approver_user_id, approver_role_id, comment, approval_status, level, department_id, section_id, approved_by) {
|
|
24
|
+
super();
|
|
25
|
+
this.request_id = request_id;
|
|
26
|
+
this.approver_user_id = approver_user_id;
|
|
27
|
+
this.approver_role_id = approver_role_id;
|
|
28
|
+
this.comment = comment;
|
|
29
|
+
this.approval_status = approval_status;
|
|
30
|
+
this.level = level;
|
|
31
|
+
this.department_id = department_id || null;
|
|
32
|
+
this.section_id = section_id || null;
|
|
33
|
+
this.approved_by = approved_by || null;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.VpnApprovalDetails = VpnApprovalDetails;
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: false }),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], VpnApprovalDetails.prototype, "request_id", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: false }),
|
|
43
|
+
__metadata("design:type", Number)
|
|
44
|
+
], VpnApprovalDetails.prototype, "level", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], VpnApprovalDetails.prototype, "approver_user_id", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], VpnApprovalDetails.prototype, "approver_role_id", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], VpnApprovalDetails.prototype, "department_id", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], VpnApprovalDetails.prototype, "section_id", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], VpnApprovalDetails.prototype, "approved_by", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true, default: "" }),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], VpnApprovalDetails.prototype, "comment", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({
|
|
71
|
+
type: "enum",
|
|
72
|
+
enum: VpnApprovalStatus,
|
|
73
|
+
default: VpnApprovalStatus.PENDING,
|
|
74
|
+
nullable: false
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], VpnApprovalDetails.prototype, "approval_status", void 0);
|
|
78
|
+
exports.VpnApprovalDetails = VpnApprovalDetails = __decorate([
|
|
79
|
+
(0, typeorm_1.Entity)({ name: "vpn_approvals" }),
|
|
80
|
+
__metadata("design:paramtypes", [Number, Object, Object, String, String, Number, Object, Object, Object])
|
|
81
|
+
], VpnApprovalDetails);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseModel } from "./BaseModel";
|
|
2
|
+
export declare class VpnRequestAttachment extends BaseModel {
|
|
3
|
+
request_id: number;
|
|
4
|
+
uploaded_by: number;
|
|
5
|
+
file_url: string;
|
|
6
|
+
file_name: string;
|
|
7
|
+
file_type: string;
|
|
8
|
+
file_size: number | null;
|
|
9
|
+
description: string;
|
|
10
|
+
constructor(request_id: number, uploaded_by: number, file_url: string, file_name?: string, file_type?: string, file_size?: number, description?: string);
|
|
11
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.VpnRequestAttachment = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let VpnRequestAttachment = class VpnRequestAttachment extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor(request_id, uploaded_by, file_url, file_name, file_type, file_size, description) {
|
|
17
|
+
super();
|
|
18
|
+
this.request_id = request_id;
|
|
19
|
+
this.uploaded_by = uploaded_by;
|
|
20
|
+
this.file_url = file_url;
|
|
21
|
+
this.file_name = file_name || "";
|
|
22
|
+
this.file_type = file_type || "";
|
|
23
|
+
this.file_size = file_size || null;
|
|
24
|
+
this.description = description || "";
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.VpnRequestAttachment = VpnRequestAttachment;
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: false }),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], VpnRequestAttachment.prototype, "request_id", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: false }),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
|
+
], VpnRequestAttachment.prototype, "uploaded_by", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 500, nullable: false }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], VpnRequestAttachment.prototype, "file_url", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], VpnRequestAttachment.prototype, "file_name", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: true }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], VpnRequestAttachment.prototype, "file_type", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: "bigint", nullable: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], VpnRequestAttachment.prototype, "file_size", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: "text", nullable: true }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], VpnRequestAttachment.prototype, "description", void 0);
|
|
56
|
+
exports.VpnRequestAttachment = VpnRequestAttachment = __decorate([
|
|
57
|
+
(0, typeorm_1.Entity)({ name: "vpn_request_attachments" }),
|
|
58
|
+
__metadata("design:paramtypes", [Number, Number, String, String, String, Number, String])
|
|
59
|
+
], VpnRequestAttachment);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseModel } from "./BaseModel";
|
|
2
|
+
export declare enum VpnMessageType {
|
|
3
|
+
TEXT = "text",
|
|
4
|
+
IMAGE = "image",
|
|
5
|
+
VIDEO = "video",
|
|
6
|
+
FILE = "file",
|
|
7
|
+
LINK = "link"
|
|
8
|
+
}
|
|
9
|
+
export declare class VpnRequestChat extends BaseModel {
|
|
10
|
+
request_id: number;
|
|
11
|
+
user_id: number;
|
|
12
|
+
message: string;
|
|
13
|
+
messageType: VpnMessageType;
|
|
14
|
+
is_internal: boolean;
|
|
15
|
+
constructor(request_id: number, user_id: number, message: string, messageType?: VpnMessageType, is_internal?: boolean);
|
|
16
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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.VpnRequestChat = exports.VpnMessageType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var VpnMessageType;
|
|
16
|
+
(function (VpnMessageType) {
|
|
17
|
+
VpnMessageType["TEXT"] = "text";
|
|
18
|
+
VpnMessageType["IMAGE"] = "image";
|
|
19
|
+
VpnMessageType["VIDEO"] = "video";
|
|
20
|
+
VpnMessageType["FILE"] = "file";
|
|
21
|
+
VpnMessageType["LINK"] = "link";
|
|
22
|
+
})(VpnMessageType || (exports.VpnMessageType = VpnMessageType = {}));
|
|
23
|
+
let VpnRequestChat = class VpnRequestChat extends BaseModel_1.BaseModel {
|
|
24
|
+
constructor(request_id, user_id, message, messageType, is_internal) {
|
|
25
|
+
super();
|
|
26
|
+
this.request_id = request_id;
|
|
27
|
+
this.user_id = user_id;
|
|
28
|
+
this.message = message;
|
|
29
|
+
this.messageType = messageType || VpnMessageType.TEXT;
|
|
30
|
+
this.is_internal = is_internal || false;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.VpnRequestChat = VpnRequestChat;
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: false }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], VpnRequestChat.prototype, "request_id", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: false }),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], VpnRequestChat.prototype, "user_id", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: "text", nullable: false }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], VpnRequestChat.prototype, "message", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({
|
|
48
|
+
type: "enum",
|
|
49
|
+
enum: VpnMessageType,
|
|
50
|
+
default: VpnMessageType.TEXT,
|
|
51
|
+
nullable: false
|
|
52
|
+
}),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], VpnRequestChat.prototype, "messageType", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({ type: "boolean", default: false }),
|
|
57
|
+
__metadata("design:type", Boolean)
|
|
58
|
+
], VpnRequestChat.prototype, "is_internal", void 0);
|
|
59
|
+
exports.VpnRequestChat = VpnRequestChat = __decorate([
|
|
60
|
+
(0, typeorm_1.Entity)({ name: "vpn_request_chat" }),
|
|
61
|
+
__metadata("design:paramtypes", [Number, Number, String, String, Boolean])
|
|
62
|
+
], VpnRequestChat);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseModel } from "./BaseModel";
|
|
2
|
+
export declare enum VpnWorkFlowStatus {
|
|
3
|
+
COMPLETED = "Completed",
|
|
4
|
+
NOT_YET_STARTED = "Not Yet Started",
|
|
5
|
+
PENDING = "Pending"
|
|
6
|
+
}
|
|
7
|
+
export declare class VpnWorkFlow extends BaseModel {
|
|
8
|
+
request_id: number;
|
|
9
|
+
order: number | null;
|
|
10
|
+
content: string;
|
|
11
|
+
status: VpnWorkFlowStatus;
|
|
12
|
+
constructor(request_id: number, content: string, status: VpnWorkFlowStatus, order?: number);
|
|
13
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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.VpnWorkFlow = exports.VpnWorkFlowStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var VpnWorkFlowStatus;
|
|
16
|
+
(function (VpnWorkFlowStatus) {
|
|
17
|
+
VpnWorkFlowStatus["COMPLETED"] = "Completed";
|
|
18
|
+
VpnWorkFlowStatus["NOT_YET_STARTED"] = "Not Yet Started";
|
|
19
|
+
VpnWorkFlowStatus["PENDING"] = "Pending";
|
|
20
|
+
})(VpnWorkFlowStatus || (exports.VpnWorkFlowStatus = VpnWorkFlowStatus = {}));
|
|
21
|
+
let VpnWorkFlow = class VpnWorkFlow extends BaseModel_1.BaseModel {
|
|
22
|
+
constructor(request_id, content, status, order) {
|
|
23
|
+
super();
|
|
24
|
+
this.request_id = request_id;
|
|
25
|
+
this.content = content;
|
|
26
|
+
this.status = status;
|
|
27
|
+
this.order = order || null;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.VpnWorkFlow = VpnWorkFlow;
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: "int", nullable: false }),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], VpnWorkFlow.prototype, "request_id", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
37
|
+
__metadata("design:type", Object)
|
|
38
|
+
], VpnWorkFlow.prototype, "order", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: false }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], VpnWorkFlow.prototype, "content", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({
|
|
45
|
+
type: "enum",
|
|
46
|
+
enum: VpnWorkFlowStatus,
|
|
47
|
+
default: VpnWorkFlowStatus.NOT_YET_STARTED,
|
|
48
|
+
nullable: false
|
|
49
|
+
}),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], VpnWorkFlow.prototype, "status", void 0);
|
|
52
|
+
exports.VpnWorkFlow = VpnWorkFlow = __decorate([
|
|
53
|
+
(0, typeorm_1.Entity)({ name: "vpn_work_flows" }),
|
|
54
|
+
__metadata("design:paramtypes", [Number, String, String, Number])
|
|
55
|
+
], VpnWorkFlow);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -42,6 +42,10 @@ import { DelegateSettings } from './models/DelegateSettingsModel';
|
|
|
42
42
|
import { Feedback } from './models/feedbackModel';
|
|
43
43
|
import { PortalFeedback } from './models/PortalFeedbackModel';
|
|
44
44
|
import { VpnRequest } from './models/VpnRequestModel';
|
|
45
|
+
import { VpnApprovalDetails } from './models/VpnApprovalModel';
|
|
46
|
+
import { VpnWorkFlow } from './models/VpnWorkflowModel';
|
|
47
|
+
import { VpnRequestAttachment } from './models/VpnRequestAttachmentModel';
|
|
48
|
+
import { VpnRequestChat } from './models/VpnRequestChatModel';
|
|
45
49
|
|
|
46
50
|
|
|
47
51
|
export const AppDataSource = new DataSource({
|
|
@@ -92,6 +96,10 @@ export const AppDataSource = new DataSource({
|
|
|
92
96
|
DelegateSettings,
|
|
93
97
|
Feedback,
|
|
94
98
|
PortalFeedback,
|
|
95
|
-
VpnRequest
|
|
99
|
+
VpnRequest,
|
|
100
|
+
VpnApprovalDetails,
|
|
101
|
+
VpnWorkFlow,
|
|
102
|
+
VpnRequestAttachment,
|
|
103
|
+
VpnRequestChat
|
|
96
104
|
],
|
|
97
105
|
});
|
package/src/index.ts
CHANGED
|
@@ -38,3 +38,7 @@ export * from './models/DelegateSettingsModel';
|
|
|
38
38
|
export * from './models/feedbackModel';
|
|
39
39
|
export * from './models/PortalFeedbackModel';
|
|
40
40
|
export * from './models/VpnRequestModel';
|
|
41
|
+
export * from './models/VpnApprovalModel';
|
|
42
|
+
export * from './models/VpnWorkflowModel';
|
|
43
|
+
export * from './models/VpnRequestChatModel';
|
|
44
|
+
export * from './models/VpnRequestAttachmentModel';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
export enum VpnApprovalStatus {
|
|
5
|
+
PENDING = "Pending",
|
|
6
|
+
IN_PROGRESS = "In Progress",
|
|
7
|
+
APPROVED = "Approved",
|
|
8
|
+
REJECTED = "Rejected"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Entity({ name: "vpn_approvals" })
|
|
12
|
+
export class VpnApprovalDetails extends BaseModel {
|
|
13
|
+
@Column({ type: "integer", nullable: false })
|
|
14
|
+
request_id: number;
|
|
15
|
+
|
|
16
|
+
@Column({ type: "integer", nullable: false })
|
|
17
|
+
level: number;
|
|
18
|
+
|
|
19
|
+
@Column({ type: "integer", nullable: true })
|
|
20
|
+
approver_user_id: number | null;
|
|
21
|
+
|
|
22
|
+
@Column({ type: "integer", nullable: true })
|
|
23
|
+
approver_role_id: number | null;
|
|
24
|
+
|
|
25
|
+
@Column({ type: "integer", nullable: true })
|
|
26
|
+
department_id: number | null;
|
|
27
|
+
|
|
28
|
+
@Column({ type: "integer", nullable: true })
|
|
29
|
+
section_id: number | null;
|
|
30
|
+
|
|
31
|
+
@Column({ type: "integer", nullable: true })
|
|
32
|
+
approved_by: number | null;
|
|
33
|
+
|
|
34
|
+
@Column({ type: "varchar", length: 255, nullable: true, default: "" })
|
|
35
|
+
comment: string;
|
|
36
|
+
|
|
37
|
+
@Column({
|
|
38
|
+
type: "enum",
|
|
39
|
+
enum: VpnApprovalStatus,
|
|
40
|
+
default: VpnApprovalStatus.PENDING,
|
|
41
|
+
nullable: false
|
|
42
|
+
})
|
|
43
|
+
approval_status: VpnApprovalStatus;
|
|
44
|
+
|
|
45
|
+
constructor(
|
|
46
|
+
request_id: number,
|
|
47
|
+
approver_user_id: number | null,
|
|
48
|
+
approver_role_id: number | null,
|
|
49
|
+
comment: string,
|
|
50
|
+
approval_status: VpnApprovalStatus,
|
|
51
|
+
level: number,
|
|
52
|
+
department_id?: number | null,
|
|
53
|
+
section_id?: number | null,
|
|
54
|
+
approved_by?: number | null
|
|
55
|
+
) {
|
|
56
|
+
super();
|
|
57
|
+
this.request_id = request_id;
|
|
58
|
+
this.approver_user_id = approver_user_id;
|
|
59
|
+
this.approver_role_id = approver_role_id;
|
|
60
|
+
this.comment = comment;
|
|
61
|
+
this.approval_status = approval_status;
|
|
62
|
+
this.level = level;
|
|
63
|
+
this.department_id = department_id || null;
|
|
64
|
+
this.section_id = section_id || null;
|
|
65
|
+
this.approved_by = approved_by || null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
@Entity({ name: "vpn_request_attachments" })
|
|
5
|
+
export class VpnRequestAttachment extends BaseModel {
|
|
6
|
+
@Column({ type: "integer", nullable: false })
|
|
7
|
+
request_id: number;
|
|
8
|
+
|
|
9
|
+
@Column({ type: "integer", nullable: false })
|
|
10
|
+
uploaded_by: number;
|
|
11
|
+
|
|
12
|
+
@Column({ type: "varchar", length: 500, nullable: false })
|
|
13
|
+
file_url: string;
|
|
14
|
+
|
|
15
|
+
@Column({ type: "varchar", length: 255, nullable: true })
|
|
16
|
+
file_name: string;
|
|
17
|
+
|
|
18
|
+
@Column({ type: "varchar", length: 100, nullable: true })
|
|
19
|
+
file_type: string;
|
|
20
|
+
|
|
21
|
+
@Column({ type: "bigint", nullable: true })
|
|
22
|
+
file_size: number | null;
|
|
23
|
+
|
|
24
|
+
@Column({ type: "text", nullable: true })
|
|
25
|
+
description: string;
|
|
26
|
+
|
|
27
|
+
constructor(
|
|
28
|
+
request_id: number,
|
|
29
|
+
uploaded_by: number,
|
|
30
|
+
file_url: string,
|
|
31
|
+
file_name?: string,
|
|
32
|
+
file_type?: string,
|
|
33
|
+
file_size?: number,
|
|
34
|
+
description?: string
|
|
35
|
+
) {
|
|
36
|
+
super();
|
|
37
|
+
this.request_id = request_id;
|
|
38
|
+
this.uploaded_by = uploaded_by;
|
|
39
|
+
this.file_url = file_url;
|
|
40
|
+
this.file_name = file_name || "";
|
|
41
|
+
this.file_type = file_type || "";
|
|
42
|
+
this.file_size = file_size || null;
|
|
43
|
+
this.description = description || "";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
export enum VpnMessageType {
|
|
5
|
+
TEXT = "text",
|
|
6
|
+
IMAGE = "image",
|
|
7
|
+
VIDEO = "video",
|
|
8
|
+
FILE = "file",
|
|
9
|
+
LINK = "link"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Entity({ name: "vpn_request_chat" })
|
|
13
|
+
export class VpnRequestChat extends BaseModel {
|
|
14
|
+
@Column({ type: "integer", nullable: false })
|
|
15
|
+
request_id: number;
|
|
16
|
+
|
|
17
|
+
@Column({ type: "integer", nullable: false })
|
|
18
|
+
user_id: number;
|
|
19
|
+
|
|
20
|
+
@Column({ type: "text", nullable: false })
|
|
21
|
+
message: string;
|
|
22
|
+
|
|
23
|
+
@Column({
|
|
24
|
+
type: "enum",
|
|
25
|
+
enum: VpnMessageType,
|
|
26
|
+
default: VpnMessageType.TEXT,
|
|
27
|
+
nullable: false
|
|
28
|
+
})
|
|
29
|
+
messageType: VpnMessageType;
|
|
30
|
+
|
|
31
|
+
@Column({ type: "boolean", default: false })
|
|
32
|
+
is_internal: boolean;
|
|
33
|
+
|
|
34
|
+
constructor(
|
|
35
|
+
request_id: number,
|
|
36
|
+
user_id: number,
|
|
37
|
+
message: string,
|
|
38
|
+
messageType?: VpnMessageType,
|
|
39
|
+
is_internal?: boolean
|
|
40
|
+
) {
|
|
41
|
+
super();
|
|
42
|
+
this.request_id = request_id;
|
|
43
|
+
this.user_id = user_id;
|
|
44
|
+
this.message = message;
|
|
45
|
+
this.messageType = messageType || VpnMessageType.TEXT;
|
|
46
|
+
this.is_internal = is_internal || false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
export enum VpnWorkFlowStatus {
|
|
5
|
+
COMPLETED = "Completed",
|
|
6
|
+
NOT_YET_STARTED = "Not Yet Started",
|
|
7
|
+
PENDING = "Pending"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@Entity({ name: "vpn_work_flows" })
|
|
11
|
+
export class VpnWorkFlow extends BaseModel {
|
|
12
|
+
@Column({ type: "int", nullable: false })
|
|
13
|
+
request_id: number;
|
|
14
|
+
|
|
15
|
+
@Column({ type: "int", nullable: true })
|
|
16
|
+
order: number | null;
|
|
17
|
+
|
|
18
|
+
@Column({ type: "varchar", length: 255, nullable: false })
|
|
19
|
+
content: string;
|
|
20
|
+
|
|
21
|
+
@Column({
|
|
22
|
+
type: "enum",
|
|
23
|
+
enum: VpnWorkFlowStatus,
|
|
24
|
+
default: VpnWorkFlowStatus.NOT_YET_STARTED,
|
|
25
|
+
nullable: false
|
|
26
|
+
})
|
|
27
|
+
status: VpnWorkFlowStatus;
|
|
28
|
+
|
|
29
|
+
constructor(
|
|
30
|
+
request_id: number,
|
|
31
|
+
content: string,
|
|
32
|
+
status: VpnWorkFlowStatus,
|
|
33
|
+
order?: number
|
|
34
|
+
) {
|
|
35
|
+
super();
|
|
36
|
+
this.request_id = request_id;
|
|
37
|
+
this.content = content;
|
|
38
|
+
this.status = status;
|
|
39
|
+
this.order = order || null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|