@platform-modules/civil-aviation-authority 1.0.26 → 1.0.28
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 +3 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/models/ItApprovalsModel.d.ts +15 -0
- package/dist/models/ItApprovalsModel.js +61 -0
- package/dist/models/ItWorkflowModel.d.ts +12 -0
- package/dist/models/ItWorkflowModel.js +46 -0
- package/package.json +1 -1
- package/src/data-source.ts +3 -1
- package/src/index.ts +2 -1
- package/src/models/ItApprovalsModel.ts +41 -0
- package/src/models/ItWorkflowModel.ts +28 -0
package/dist/data-source.js
CHANGED
|
@@ -15,6 +15,8 @@ const CAAServices_1 = require("./models/CAAServices");
|
|
|
15
15
|
const CAASubServices_1 = require("./models/CAASubServices");
|
|
16
16
|
const ITApprovalSettings_1 = require("./models/ITApprovalSettings");
|
|
17
17
|
const Workflows_1 = require("./models/Workflows");
|
|
18
|
+
const ItApprovalsModel_1 = require("./models/ItApprovalsModel");
|
|
19
|
+
const ItWorkflowModel_1 = require("./models/ItWorkflowModel");
|
|
18
20
|
exports.AppDataSource = new typeorm_1.DataSource({
|
|
19
21
|
type: 'postgres',
|
|
20
22
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -24,5 +26,5 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
24
26
|
database: process.env.DB_NAME || 'common_models',
|
|
25
27
|
synchronize: true, // auto-create tables (disable in prod)
|
|
26
28
|
logging: false,
|
|
27
|
-
entities: [user_1.User, user_sessions_1.userSessions, role_1.Role, ITHelpDeskModel_1.ITHelpDeskRequests, ITServicesTypesSalalahModel_1.ITServicesTypesSalalah, ITServicesTypesMuscatModel_1.ITServicesTypesMuscat, CAAServices_1.CAAServices, CAASubServices_1.CAASubServices, ITApprovalSettings_1.ITApprovalSettings, Workflows_1.Workflows],
|
|
29
|
+
entities: [user_1.User, user_sessions_1.userSessions, role_1.Role, ITHelpDeskModel_1.ITHelpDeskRequests, ITServicesTypesSalalahModel_1.ITServicesTypesSalalah, ITServicesTypesMuscatModel_1.ITServicesTypesMuscat, CAAServices_1.CAAServices, CAASubServices_1.CAASubServices, ITApprovalSettings_1.ITApprovalSettings, Workflows_1.Workflows, ItApprovalsModel_1.ItApprovalDetails, ItWorkflowModel_1.ItWorkFlow],
|
|
28
30
|
});
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -24,3 +24,5 @@ __exportStar(require("./models/CAAServices"), exports);
|
|
|
24
24
|
__exportStar(require("./models/CAASubServices"), exports);
|
|
25
25
|
__exportStar(require("./models/ITApprovalSettings"), exports);
|
|
26
26
|
__exportStar(require("./models/Workflows"), exports);
|
|
27
|
+
__exportStar(require("./models/ItApprovalsModel"), exports);
|
|
28
|
+
__exportStar(require("./models/ItWorkflowModel"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare enum ApprovalStatus {
|
|
3
|
+
PENDING = "Pending",
|
|
4
|
+
APPROVED = "Approved",
|
|
5
|
+
REJECTED = "Rejected"
|
|
6
|
+
}
|
|
7
|
+
export declare class ItApprovalDetails extends BaseModel {
|
|
8
|
+
request_id: number;
|
|
9
|
+
level: number;
|
|
10
|
+
approver_user_id: number;
|
|
11
|
+
approver_role_id: number;
|
|
12
|
+
comment: string;
|
|
13
|
+
approval_status: ApprovalStatus;
|
|
14
|
+
constructor(request_id: number, approver_user_id: number, approver_role_id: number, comment: string, approval_status: ApprovalStatus, level: number);
|
|
15
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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.ItApprovalDetails = exports.ApprovalStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var ApprovalStatus;
|
|
16
|
+
(function (ApprovalStatus) {
|
|
17
|
+
ApprovalStatus["PENDING"] = "Pending";
|
|
18
|
+
ApprovalStatus["APPROVED"] = "Approved";
|
|
19
|
+
ApprovalStatus["REJECTED"] = "Rejected";
|
|
20
|
+
})(ApprovalStatus || (exports.ApprovalStatus = ApprovalStatus = {}));
|
|
21
|
+
//This model is used to store the store the leave apporval details of the user for the leave request
|
|
22
|
+
let ItApprovalDetails = class ItApprovalDetails extends BaseModel_1.BaseModel {
|
|
23
|
+
constructor(request_id, approver_user_id, approver_role_id, comment, approval_status, level) {
|
|
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
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.ItApprovalDetails = ItApprovalDetails;
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], ItApprovalDetails.prototype, "request_id", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], ItApprovalDetails.prototype, "level", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], ItApprovalDetails.prototype, "approver_user_id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], ItApprovalDetails.prototype, "approver_role_id", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], ItApprovalDetails.prototype, "comment", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: ApprovalStatus, default: ApprovalStatus.PENDING, nullable: false }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], ItApprovalDetails.prototype, "approval_status", void 0);
|
|
58
|
+
exports.ItApprovalDetails = ItApprovalDetails = __decorate([
|
|
59
|
+
(0, typeorm_1.Entity)({ name: 'it_approvals' }),
|
|
60
|
+
__metadata("design:paramtypes", [Number, Number, Number, String, String, Number])
|
|
61
|
+
], ItApprovalDetails);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare enum workFlowStatus {
|
|
3
|
+
COMPLETED = "Completed",
|
|
4
|
+
NOT_YET_STARTED = "Not Yet Started",
|
|
5
|
+
PENDING = "Pending"
|
|
6
|
+
}
|
|
7
|
+
export declare class ItWorkFlow extends BaseModel {
|
|
8
|
+
request_id: number;
|
|
9
|
+
content: string;
|
|
10
|
+
status: workFlowStatus;
|
|
11
|
+
constructor(request_id: number, content: string, status: workFlowStatus);
|
|
12
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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.ItWorkFlow = exports.workFlowStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var workFlowStatus;
|
|
16
|
+
(function (workFlowStatus) {
|
|
17
|
+
workFlowStatus["COMPLETED"] = "Completed";
|
|
18
|
+
workFlowStatus["NOT_YET_STARTED"] = "Not Yet Started";
|
|
19
|
+
workFlowStatus["PENDING"] = "Pending";
|
|
20
|
+
})(workFlowStatus || (exports.workFlowStatus = workFlowStatus = {}));
|
|
21
|
+
//This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
|
|
22
|
+
let ItWorkFlow = class ItWorkFlow extends BaseModel_1.BaseModel {
|
|
23
|
+
constructor(request_id, content, status) {
|
|
24
|
+
super();
|
|
25
|
+
this.request_id = request_id;
|
|
26
|
+
this.content = content;
|
|
27
|
+
this.status = status;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.ItWorkFlow = ItWorkFlow;
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], ItWorkFlow.prototype, "request_id", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], ItWorkFlow.prototype, "content", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: workFlowStatus, default: workFlowStatus.NOT_YET_STARTED, nullable: false }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], ItWorkFlow.prototype, "status", void 0);
|
|
43
|
+
exports.ItWorkFlow = ItWorkFlow = __decorate([
|
|
44
|
+
(0, typeorm_1.Entity)({ name: 'it_work_flows' }),
|
|
45
|
+
__metadata("design:paramtypes", [Number, String, String])
|
|
46
|
+
], ItWorkFlow);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -12,6 +12,8 @@ import { CAAServices } from './models/CAAServices';
|
|
|
12
12
|
import { CAASubServices } from './models/CAASubServices';
|
|
13
13
|
import { ITApprovalSettings } from './models/ITApprovalSettings';
|
|
14
14
|
import { Workflows } from './models/Workflows';
|
|
15
|
+
import { ItApprovalDetails } from './models/ItApprovalsModel';
|
|
16
|
+
import { ItWorkFlow } from './models/ItWorkflowModel';
|
|
15
17
|
export const AppDataSource = new DataSource({
|
|
16
18
|
type: 'postgres',
|
|
17
19
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -21,5 +23,5 @@ export const AppDataSource = new DataSource({
|
|
|
21
23
|
database: process.env.DB_NAME || 'common_models',
|
|
22
24
|
synchronize: true, // auto-create tables (disable in prod)
|
|
23
25
|
logging: false,
|
|
24
|
-
entities: [User,userSessions,Role, ITHelpDeskRequests, ITServicesTypesSalalah, ITServicesTypesMuscat, CAAServices, CAASubServices, ITApprovalSettings, Workflows],
|
|
26
|
+
entities: [User,userSessions,Role, ITHelpDeskRequests, ITServicesTypesSalalah, ITServicesTypesMuscat, CAAServices, CAASubServices, ITApprovalSettings, Workflows, ItApprovalDetails, ItWorkFlow],
|
|
25
27
|
});
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export enum ApprovalStatus {
|
|
6
|
+
PENDING = "Pending",
|
|
7
|
+
APPROVED = "Approved",
|
|
8
|
+
REJECTED = "Rejected"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//This model is used to store the store the leave apporval details of the user for the leave request
|
|
12
|
+
@Entity({ name: 'it_approvals' })
|
|
13
|
+
export class ItApprovalDetails extends BaseModel {
|
|
14
|
+
@Column({ type: 'int', nullable: false })
|
|
15
|
+
request_id: number;
|
|
16
|
+
|
|
17
|
+
@Column({ type: 'int', nullable: false })
|
|
18
|
+
level: number;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'int', nullable: true })
|
|
21
|
+
approver_user_id: number;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'int', nullable: false })
|
|
24
|
+
approver_role_id: number;
|
|
25
|
+
|
|
26
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
27
|
+
comment: string;
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'enum', enum: ApprovalStatus,default: ApprovalStatus.PENDING, nullable: false })
|
|
30
|
+
approval_status: ApprovalStatus;
|
|
31
|
+
|
|
32
|
+
constructor(request_id: number, approver_user_id: number, approver_role_id: number, comment: string, approval_status: ApprovalStatus, level: number) {
|
|
33
|
+
super();
|
|
34
|
+
this.request_id = request_id;
|
|
35
|
+
this.approver_user_id = approver_user_id;
|
|
36
|
+
this.approver_role_id = approver_role_id;
|
|
37
|
+
this.comment = comment;
|
|
38
|
+
this.approval_status = approval_status;
|
|
39
|
+
this.level = level;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum workFlowStatus {
|
|
5
|
+
COMPLETED = "Completed",
|
|
6
|
+
NOT_YET_STARTED = "Not Yet Started",
|
|
7
|
+
PENDING = "Pending"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
|
|
11
|
+
@Entity({ name: 'it_work_flows' })
|
|
12
|
+
export class ItWorkFlow extends BaseModel {
|
|
13
|
+
@Column({ type: 'int', nullable: false })
|
|
14
|
+
request_id: number;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
17
|
+
content: string;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'enum', enum: workFlowStatus, default: workFlowStatus.NOT_YET_STARTED, nullable: false })
|
|
20
|
+
status: workFlowStatus;
|
|
21
|
+
|
|
22
|
+
constructor(request_id: number, content: string, status: workFlowStatus) {
|
|
23
|
+
super();
|
|
24
|
+
this.request_id = request_id;
|
|
25
|
+
this.content = content;
|
|
26
|
+
this.status = status;
|
|
27
|
+
}
|
|
28
|
+
}
|