@platform-modules/civil-aviation-authority 1.0.39 → 1.0.41
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 +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/models/ItApprovalsModel.js +0 -1
- package/dist/models/PositionModel.d.ts +6 -0
- package/dist/models/PositionModel.js +34 -0
- package/dist/models/SectionModel.d.ts +1 -1
- package/dist/models/SectionModel.js +10 -10
- package/dist/models/user.d.ts +5 -4
- package/dist/models/user.js +8 -4
- package/package.json +1 -1
- package/src/data-source.ts +6 -2
- package/src/index.ts +1 -1
- package/src/models/ItApprovalsModel.ts +0 -1
- package/src/models/PositionModel.ts +19 -0
- package/src/models/SectionModel.ts +2 -2
- package/src/models/user.ts +9 -6
package/dist/data-source.js
CHANGED
|
@@ -24,6 +24,7 @@ const SectionModel_1 = require("./models/SectionModel");
|
|
|
24
24
|
const WorkflowHierarchy_1 = require("./models/WorkflowHierarchy");
|
|
25
25
|
const WorkflowTaskNames_1 = require("./models/WorkflowTaskNames");
|
|
26
26
|
const DirectorateModel_1 = require("./models/DirectorateModel");
|
|
27
|
+
const PositionModel_1 = require("./models/PositionModel");
|
|
27
28
|
exports.AppDataSource = new typeorm_1.DataSource({
|
|
28
29
|
type: 'postgres',
|
|
29
30
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -33,5 +34,5 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
33
34
|
database: process.env.DB_NAME || 'common_models',
|
|
34
35
|
synchronize: true, // auto-create tables (disable in prod)
|
|
35
36
|
logging: false,
|
|
36
|
-
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, WorkflowDefinitions_1.WorkflowDefinitions, WorkflowTask_1.WorkflowTask, DepartmentsModel_1.Departments, SectionModel_1.
|
|
37
|
+
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, WorkflowDefinitions_1.WorkflowDefinitions, WorkflowTask_1.WorkflowTask, DepartmentsModel_1.Departments, SectionModel_1.Sections, WorkflowHierarchy_1.WorkflowHierarchy, WorkflowTaskNames_1.WorkflowTaskNames, DirectorateModel_1.Directorate, PositionModel_1.Position],
|
|
37
38
|
});
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -33,3 +33,4 @@ __exportStar(require("./models/SectionModel"), exports);
|
|
|
33
33
|
__exportStar(require("./models/WorkflowHierarchy"), exports);
|
|
34
34
|
__exportStar(require("./models/WorkflowTaskNames"), exports);
|
|
35
35
|
__exportStar(require("./models/DirectorateModel"), exports);
|
|
36
|
+
__exportStar(require("./models/PositionModel"), exports);
|
|
@@ -18,7 +18,6 @@ var ApprovalStatus;
|
|
|
18
18
|
ApprovalStatus["APPROVED"] = "Approved";
|
|
19
19
|
ApprovalStatus["REJECTED"] = "Rejected";
|
|
20
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
21
|
let ItApprovalDetails = class ItApprovalDetails extends BaseModel_1.BaseModel {
|
|
23
22
|
constructor(request_id, approver_user_id, approver_role_id, comment, approval_status, level) {
|
|
24
23
|
super();
|
|
@@ -0,0 +1,34 @@
|
|
|
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.Position = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let Position = class Position extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor(name, is_deleted) {
|
|
17
|
+
super();
|
|
18
|
+
this.name = name;
|
|
19
|
+
this.is_deleted = is_deleted;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.Position = Position;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], Position.prototype, "name", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
29
|
+
__metadata("design:type", Boolean)
|
|
30
|
+
], Position.prototype, "is_deleted", void 0);
|
|
31
|
+
exports.Position = Position = __decorate([
|
|
32
|
+
(0, typeorm_1.Entity)({ name: 'position' }),
|
|
33
|
+
__metadata("design:paramtypes", [String, Boolean])
|
|
34
|
+
], Position);
|
|
@@ -9,10 +9,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.Sections = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const BaseModel_1 = require("./BaseModel");
|
|
15
|
-
let
|
|
15
|
+
let Sections = class Sections extends BaseModel_1.BaseModel {
|
|
16
16
|
constructor(section_name, section_code, section_description, department_id) {
|
|
17
17
|
super();
|
|
18
18
|
this.section_name = section_name;
|
|
@@ -21,24 +21,24 @@ let UserSections = class UserSections extends BaseModel_1.BaseModel {
|
|
|
21
21
|
this.department_id = department_id;
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
exports.
|
|
24
|
+
exports.Sections = Sections;
|
|
25
25
|
__decorate([
|
|
26
26
|
(0, typeorm_1.Column)({ type: 'varchar', length: 64, nullable: false, unique: true }),
|
|
27
27
|
__metadata("design:type", String)
|
|
28
|
-
],
|
|
28
|
+
], Sections.prototype, "section_name", void 0);
|
|
29
29
|
__decorate([
|
|
30
30
|
(0, typeorm_1.Column)({ type: 'varchar', length: 64, nullable: false, unique: true }),
|
|
31
31
|
__metadata("design:type", String)
|
|
32
|
-
],
|
|
32
|
+
], Sections.prototype, "section_code", void 0);
|
|
33
33
|
__decorate([
|
|
34
34
|
(0, typeorm_1.Column)({ nullable: false }),
|
|
35
35
|
__metadata("design:type", String)
|
|
36
|
-
],
|
|
36
|
+
], Sections.prototype, "section_description", void 0);
|
|
37
37
|
__decorate([
|
|
38
38
|
(0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
|
|
39
39
|
__metadata("design:type", Number)
|
|
40
|
-
],
|
|
41
|
-
exports.
|
|
42
|
-
(0, typeorm_1.Entity)({ name: '
|
|
40
|
+
], Sections.prototype, "department_id", void 0);
|
|
41
|
+
exports.Sections = Sections = __decorate([
|
|
42
|
+
(0, typeorm_1.Entity)({ name: 'sections' }),
|
|
43
43
|
__metadata("design:paramtypes", [String, String, String, Number])
|
|
44
|
-
],
|
|
44
|
+
], Sections);
|
package/dist/models/user.d.ts
CHANGED
|
@@ -20,15 +20,16 @@ export declare class User extends BaseModel {
|
|
|
20
20
|
manpower_id?: number;
|
|
21
21
|
mobile?: string;
|
|
22
22
|
office_number?: string;
|
|
23
|
-
department?:
|
|
23
|
+
department?: number;
|
|
24
24
|
category?: string;
|
|
25
25
|
directorate?: string;
|
|
26
|
-
section?:
|
|
27
|
-
position?:
|
|
26
|
+
section?: number;
|
|
27
|
+
position?: number;
|
|
28
28
|
arabic_position?: string;
|
|
29
29
|
grade?: number;
|
|
30
30
|
location?: string;
|
|
31
31
|
supervisor_emp_id?: number;
|
|
32
32
|
supervisor_emp_name?: string;
|
|
33
|
-
|
|
33
|
+
is_admin?: boolean;
|
|
34
|
+
constructor(employee_id?: number, civil_employee_id?: number, employee_name?: string, employee_arabic_name?: string, person_type?: string, date_of_birth?: string, region_of_birth?: string, country_of_birth?: string, date_of_joining?: string, last_promotion_date?: string, gender?: string, qualification?: string, marital_status?: string, nationality?: string, email?: string, blood_type?: string, national_id?: number, manpower_id?: number, mobile?: string, office_number?: string, department?: number, category?: string, directorate?: string, section?: number, position?: number, arabic_position?: string, grade?: number, location?: string, supervisor_emp_id?: number, supervisor_emp_name?: string);
|
|
34
35
|
}
|
package/dist/models/user.js
CHANGED
|
@@ -130,7 +130,7 @@ __decorate([
|
|
|
130
130
|
], User.prototype, "office_number", void 0);
|
|
131
131
|
__decorate([
|
|
132
132
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
133
|
-
__metadata("design:type",
|
|
133
|
+
__metadata("design:type", Number)
|
|
134
134
|
], User.prototype, "department", void 0);
|
|
135
135
|
__decorate([
|
|
136
136
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
@@ -142,11 +142,11 @@ __decorate([
|
|
|
142
142
|
], User.prototype, "directorate", void 0);
|
|
143
143
|
__decorate([
|
|
144
144
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
145
|
-
__metadata("design:type",
|
|
145
|
+
__metadata("design:type", Number)
|
|
146
146
|
], User.prototype, "section", void 0);
|
|
147
147
|
__decorate([
|
|
148
148
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
149
|
-
__metadata("design:type",
|
|
149
|
+
__metadata("design:type", Number)
|
|
150
150
|
], User.prototype, "position", void 0);
|
|
151
151
|
__decorate([
|
|
152
152
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
@@ -168,7 +168,11 @@ __decorate([
|
|
|
168
168
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
169
169
|
__metadata("design:type", String)
|
|
170
170
|
], User.prototype, "supervisor_emp_name", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
(0, typeorm_1.Column)({ nullable: true, default: false }),
|
|
173
|
+
__metadata("design:type", Boolean)
|
|
174
|
+
], User.prototype, "is_admin", void 0);
|
|
171
175
|
exports.User = User = __decorate([
|
|
172
176
|
(0, typeorm_1.Entity)({ name: 'users' }),
|
|
173
|
-
__metadata("design:paramtypes", [Number, Number, String, String, String, String, String, String, String, String, String, String, String, String, String, String, Number, Number, String, String,
|
|
177
|
+
__metadata("design:paramtypes", [Number, Number, String, String, String, String, String, String, String, String, String, String, String, String, String, String, Number, Number, String, String, Number, String, String, Number, Number, String, Number, String, Number, String])
|
|
174
178
|
], User);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -17,10 +17,14 @@ import { ItWorkFlow } from './models/ItWorkflowModel';
|
|
|
17
17
|
import { WorkflowDefinitions } from './models/WorkflowDefinitions';
|
|
18
18
|
import { WorkflowTask } from './models/WorkflowTask';
|
|
19
19
|
import { Departments } from './models/DepartmentsModel';
|
|
20
|
-
import {
|
|
20
|
+
import { Sections } from './models/SectionModel';
|
|
21
21
|
import { WorkflowHierarchy } from './models/WorkflowHierarchy';
|
|
22
22
|
import { WorkflowTaskNames } from './models/WorkflowTaskNames';
|
|
23
23
|
import { Directorate } from './models/DirectorateModel';
|
|
24
|
+
import { Position } from './models/PositionModel';
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
24
28
|
export const AppDataSource = new DataSource({
|
|
25
29
|
type: 'postgres',
|
|
26
30
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -30,5 +34,5 @@ export const AppDataSource = new DataSource({
|
|
|
30
34
|
database: process.env.DB_NAME || 'common_models',
|
|
31
35
|
synchronize: true, // auto-create tables (disable in prod)
|
|
32
36
|
logging: false,
|
|
33
|
-
entities: [User,userSessions,Role, ITHelpDeskRequests, ITServicesTypesSalalah, ITServicesTypesMuscat, CAAServices, CAASubServices, ITApprovalSettings, Workflows, ItApprovalDetails, ItWorkFlow, WorkflowDefinitions, WorkflowTask, Departments,
|
|
37
|
+
entities: [User,userSessions,Role, ITHelpDeskRequests, ITServicesTypesSalalah, ITServicesTypesMuscat, CAAServices, CAASubServices, ITApprovalSettings, Workflows, ItApprovalDetails, ItWorkFlow, WorkflowDefinitions, WorkflowTask, Departments, Sections, WorkflowHierarchy, WorkflowTaskNames, Directorate, Position],
|
|
34
38
|
});
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,6 @@ export enum ApprovalStatus {
|
|
|
8
8
|
REJECTED = "Rejected"
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
//This model is used to store the store the leave apporval details of the user for the leave request
|
|
12
11
|
@Entity({ name: 'it_approvals' })
|
|
13
12
|
export class ItApprovalDetails extends BaseModel {
|
|
14
13
|
@Column({ type: 'int', nullable: false })
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'position' })
|
|
5
|
+
export class Position extends BaseModel {
|
|
6
|
+
|
|
7
|
+
@Column({ nullable: true })
|
|
8
|
+
name: string;
|
|
9
|
+
|
|
10
|
+
@Column({ nullable: true })
|
|
11
|
+
is_deleted?: boolean;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
constructor(name: string,is_deleted:boolean) {
|
|
15
|
+
super();
|
|
16
|
+
this.name = name
|
|
17
|
+
this.is_deleted = is_deleted
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Column, Entity } from "typeorm";
|
|
2
2
|
import { BaseModel } from './BaseModel';
|
|
3
3
|
|
|
4
|
-
@Entity({ name: '
|
|
5
|
-
export class
|
|
4
|
+
@Entity({ name: 'sections' })
|
|
5
|
+
export class Sections extends BaseModel {
|
|
6
6
|
|
|
7
7
|
@Column({ type: 'varchar', length: 64, nullable: false, unique: true })
|
|
8
8
|
section_name: string;
|
package/src/models/user.ts
CHANGED
|
@@ -65,7 +65,7 @@ export class User extends BaseModel {
|
|
|
65
65
|
office_number?: string;
|
|
66
66
|
|
|
67
67
|
@Column({ nullable: true })
|
|
68
|
-
department?:
|
|
68
|
+
department?: number;
|
|
69
69
|
|
|
70
70
|
@Column({ nullable: true })
|
|
71
71
|
category?: string;
|
|
@@ -74,10 +74,10 @@ export class User extends BaseModel {
|
|
|
74
74
|
directorate?: string;
|
|
75
75
|
|
|
76
76
|
@Column({ nullable: true })
|
|
77
|
-
section?:
|
|
77
|
+
section?: number;
|
|
78
78
|
|
|
79
79
|
@Column({ nullable: true })
|
|
80
|
-
position?:
|
|
80
|
+
position?: number;
|
|
81
81
|
|
|
82
82
|
@Column({ nullable: true })
|
|
83
83
|
arabic_position?: string;
|
|
@@ -94,6 +94,9 @@ export class User extends BaseModel {
|
|
|
94
94
|
@Column({ nullable: true })
|
|
95
95
|
supervisor_emp_name?: string;
|
|
96
96
|
|
|
97
|
+
@Column({ nullable: true , default: false})
|
|
98
|
+
is_admin?: boolean;
|
|
99
|
+
|
|
97
100
|
constructor(
|
|
98
101
|
employee_id?: number,
|
|
99
102
|
civil_employee_id?: number,
|
|
@@ -115,11 +118,11 @@ export class User extends BaseModel {
|
|
|
115
118
|
manpower_id?: number,
|
|
116
119
|
mobile?: string,
|
|
117
120
|
office_number?: string,
|
|
118
|
-
department?:
|
|
121
|
+
department?: number,
|
|
119
122
|
category?: string,
|
|
120
123
|
directorate?: string,
|
|
121
|
-
section?:
|
|
122
|
-
position?:
|
|
124
|
+
section?: number,
|
|
125
|
+
position?: number,
|
|
123
126
|
arabic_position?: string,
|
|
124
127
|
grade?: number,
|
|
125
128
|
location?: string,
|