@platform-modules/civil-aviation-authority 2.0.3 → 2.0.5
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/.env +9 -7
- package/dist/data-source.js +11 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/models/CAAServices.d.ts +2 -1
- package/dist/models/CAAServices.js +7 -2
- package/dist/models/ITServicesTypesModel.d.ts +5 -0
- package/dist/models/ITServicesTypesModel.js +29 -0
- package/dist/models/LogisticsApprovalModel.d.ts +17 -0
- package/dist/models/LogisticsApprovalModel.js +70 -0
- package/dist/models/LogisticsAttachmentModel.d.ts +9 -0
- package/dist/models/LogisticsAttachmentModel.js +49 -0
- package/dist/models/LogisticsChatModel.d.ts +7 -0
- package/dist/models/LogisticsChatModel.js +39 -0
- package/dist/models/LogisticsModel.d.ts +52 -0
- package/dist/models/LogisticsModel.js +180 -0
- package/dist/models/LogisticsWorkflowModel.d.ts +12 -0
- package/dist/models/LogisticsWorkflowModel.js +46 -0
- package/package.json +1 -1
- package/src/data-source.ts +84 -74
- package/src/index.ts +33 -28
- package/src/models/BaseModel.ts +46 -46
- package/src/models/CAAServices.ts +6 -1
- package/src/models/ITHelpDeskModel.ts +114 -114
- package/src/models/ItApprovalsModel.ts +61 -61
- package/src/models/LogisticsApprovalModel.ts +57 -0
- package/src/models/LogisticsAttachmentModel.ts +40 -0
- package/src/models/LogisticsChatModel.ts +29 -0
- package/src/models/LogisticsModel.ts +167 -0
- package/src/models/LogisticsWorkflowModel.ts +28 -0
|
@@ -1,62 +1,62 @@
|
|
|
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
|
-
@Entity({ name: 'it_approvals' })
|
|
12
|
-
export class ItApprovalDetails 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: false })
|
|
23
|
-
approver_role_id: number;
|
|
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: false })
|
|
35
|
-
comment: string;
|
|
36
|
-
|
|
37
|
-
@Column({ type: 'enum', enum: ApprovalStatus,default: ApprovalStatus.PENDING, nullable: false })
|
|
38
|
-
approval_status: ApprovalStatus;
|
|
39
|
-
|
|
40
|
-
constructor(
|
|
41
|
-
request_id: number,
|
|
42
|
-
approver_user_id: number | null,
|
|
43
|
-
approver_role_id: number,
|
|
44
|
-
comment: string,
|
|
45
|
-
approval_status: ApprovalStatus,
|
|
46
|
-
level: number,
|
|
47
|
-
department_id?: number | null,
|
|
48
|
-
section_id?: number | null,
|
|
49
|
-
approved_by?: number | null
|
|
50
|
-
) {
|
|
51
|
-
super();
|
|
52
|
-
this.request_id = request_id;
|
|
53
|
-
this.approver_user_id = approver_user_id;
|
|
54
|
-
this.approver_role_id = approver_role_id;
|
|
55
|
-
this.comment = comment;
|
|
56
|
-
this.approval_status = approval_status;
|
|
57
|
-
this.level = level;
|
|
58
|
-
this.department_id = department_id || null;
|
|
59
|
-
this.section_id = section_id || null;
|
|
60
|
-
this.approved_by = approved_by || null;
|
|
61
|
-
}
|
|
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
|
+
@Entity({ name: 'it_approvals' })
|
|
12
|
+
export class ItApprovalDetails 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: false })
|
|
23
|
+
approver_role_id: number;
|
|
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: false })
|
|
35
|
+
comment: string;
|
|
36
|
+
|
|
37
|
+
@Column({ type: 'enum', enum: ApprovalStatus,default: ApprovalStatus.PENDING, nullable: false })
|
|
38
|
+
approval_status: ApprovalStatus;
|
|
39
|
+
|
|
40
|
+
constructor(
|
|
41
|
+
request_id: number,
|
|
42
|
+
approver_user_id: number | null,
|
|
43
|
+
approver_role_id: number,
|
|
44
|
+
comment: string,
|
|
45
|
+
approval_status: ApprovalStatus,
|
|
46
|
+
level: number,
|
|
47
|
+
department_id?: number | null,
|
|
48
|
+
section_id?: number | null,
|
|
49
|
+
approved_by?: number | null
|
|
50
|
+
) {
|
|
51
|
+
super();
|
|
52
|
+
this.request_id = request_id;
|
|
53
|
+
this.approver_user_id = approver_user_id;
|
|
54
|
+
this.approver_role_id = approver_role_id;
|
|
55
|
+
this.comment = comment;
|
|
56
|
+
this.approval_status = approval_status;
|
|
57
|
+
this.level = level;
|
|
58
|
+
this.department_id = department_id || null;
|
|
59
|
+
this.section_id = section_id || null;
|
|
60
|
+
this.approved_by = approved_by || null;
|
|
61
|
+
}
|
|
62
62
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export enum LogisticsApprovalStatus {
|
|
6
|
+
PENDING = "Pending",
|
|
7
|
+
APPROVED = "Approved",
|
|
8
|
+
REJECTED = "Rejected"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Entity({ name: 'logistics_approvals' })
|
|
12
|
+
export class LogisticsApprovalDetails 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: false })
|
|
20
|
+
approver_role_id: number;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'integer', nullable: true })
|
|
23
|
+
department_id: number | null;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'integer', nullable: true })
|
|
26
|
+
section_id: number | null;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'integer', nullable: true })
|
|
29
|
+
approved_by: number | null;
|
|
30
|
+
|
|
31
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
32
|
+
comment: string;
|
|
33
|
+
|
|
34
|
+
@Column({ type: 'enum', enum: LogisticsApprovalStatus,default: LogisticsApprovalStatus.PENDING, nullable: false })
|
|
35
|
+
approval_status: LogisticsApprovalStatus;
|
|
36
|
+
|
|
37
|
+
constructor(
|
|
38
|
+
request_id: number,
|
|
39
|
+
approver_role_id: number,
|
|
40
|
+
comment: string,
|
|
41
|
+
approval_status: LogisticsApprovalStatus,
|
|
42
|
+
level: number,
|
|
43
|
+
department_id?: number | null,
|
|
44
|
+
section_id?: number | null,
|
|
45
|
+
approved_by?: number | null
|
|
46
|
+
) {
|
|
47
|
+
super();
|
|
48
|
+
this.request_id = request_id;
|
|
49
|
+
this.approver_role_id = approver_role_id;
|
|
50
|
+
this.comment = comment;
|
|
51
|
+
this.approval_status = approval_status;
|
|
52
|
+
this.level = level;
|
|
53
|
+
this.department_id = department_id || null;
|
|
54
|
+
this.section_id = section_id || null;
|
|
55
|
+
this.approved_by = approved_by || null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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: 'logistics_request_attachments' })
|
|
7
|
+
export class LogisticsRequestAttachment extends BaseModel {
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'integer', nullable: false })
|
|
10
|
+
request_id: 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
|
+
|
|
25
|
+
constructor(
|
|
26
|
+
request_id: number,
|
|
27
|
+
file_url: string,
|
|
28
|
+
file_name?: string,
|
|
29
|
+
file_type?: string,
|
|
30
|
+
file_size?: number,
|
|
31
|
+
) {
|
|
32
|
+
super();
|
|
33
|
+
this.request_id = request_id;
|
|
34
|
+
this.file_url = file_url;
|
|
35
|
+
this.file_name = file_name || '';
|
|
36
|
+
this.file_type = file_type || '';
|
|
37
|
+
this.file_size = file_size || null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
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: 'logistics_request_chat' })
|
|
7
|
+
export class LogisticsRequestChat extends BaseModel {
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'integer', nullable: false })
|
|
10
|
+
request_id: number;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'integer', nullable: false })
|
|
13
|
+
user_id: number;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'text', nullable: false })
|
|
16
|
+
message: string;
|
|
17
|
+
|
|
18
|
+
constructor(
|
|
19
|
+
request_id: number,
|
|
20
|
+
user_id: number,
|
|
21
|
+
message: string,
|
|
22
|
+
) {
|
|
23
|
+
super();
|
|
24
|
+
this.request_id = request_id;
|
|
25
|
+
this.user_id = user_id;
|
|
26
|
+
this.message = message;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum Request_Type {
|
|
5
|
+
DAILY = "Daily",
|
|
6
|
+
EMERGENCY = "Emergency"
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export enum Status {
|
|
10
|
+
PENDING = "Pending",
|
|
11
|
+
ASSIGNED = "Assigned",
|
|
12
|
+
IN_PROGRESS = "In Progress",
|
|
13
|
+
APPROVED = "Approved",
|
|
14
|
+
REJECTED = "Rejected"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum Vehicle_Required_For {
|
|
18
|
+
CONFERENCES = "Conferences",
|
|
19
|
+
CELEBRATIONS = "Celebrations and Official Meetings",
|
|
20
|
+
OTHERS = "Others"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export enum Vehicle_Required_Location {
|
|
24
|
+
INSIDE = "Inside Muscat",
|
|
25
|
+
OUTSIDE = "Outside Muscat"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export enum Purpose_of_Travel {
|
|
29
|
+
SITE = "Site Visit",
|
|
30
|
+
AIRPORT = "Airport Duty",
|
|
31
|
+
OFFICIAL = "Official Meeting",
|
|
32
|
+
OTHER = "Other"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export enum Type_of_Vehicle {
|
|
36
|
+
SEDAN = "Sedan",
|
|
37
|
+
SUV = "SUV"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@Entity({ name: 'logistics_requests' })
|
|
41
|
+
export class LogisticsRequests extends BaseModel {
|
|
42
|
+
|
|
43
|
+
@Column({ type: 'int', nullable: true })
|
|
44
|
+
req_user_department_id: number | null;
|
|
45
|
+
|
|
46
|
+
@Column({ type: 'int', nullable: true })
|
|
47
|
+
req_user_section_id: number | null;
|
|
48
|
+
|
|
49
|
+
@Column({ nullable: true })
|
|
50
|
+
service_id: number;
|
|
51
|
+
|
|
52
|
+
@Column({ nullable: true })
|
|
53
|
+
sub_service_id: number;
|
|
54
|
+
|
|
55
|
+
@Column({ nullable: false })
|
|
56
|
+
user_id: number;
|
|
57
|
+
|
|
58
|
+
@Column({
|
|
59
|
+
type: "enum",
|
|
60
|
+
enum: Request_Type,
|
|
61
|
+
default: Request_Type.DAILY,
|
|
62
|
+
nullable: false,
|
|
63
|
+
})
|
|
64
|
+
request_type: Request_Type;
|
|
65
|
+
|
|
66
|
+
@Column({
|
|
67
|
+
type: "enum",
|
|
68
|
+
enum: Vehicle_Required_For,
|
|
69
|
+
default: Vehicle_Required_For.OTHERS,
|
|
70
|
+
nullable: false,
|
|
71
|
+
})
|
|
72
|
+
vehicle_required_for: Vehicle_Required_For;
|
|
73
|
+
|
|
74
|
+
@Column({
|
|
75
|
+
type: "enum",
|
|
76
|
+
enum: Vehicle_Required_Location,
|
|
77
|
+
default: Vehicle_Required_Location.INSIDE,
|
|
78
|
+
nullable: false,
|
|
79
|
+
})
|
|
80
|
+
vehicle_required_location: Vehicle_Required_Location;
|
|
81
|
+
|
|
82
|
+
@Column({ nullable: false })
|
|
83
|
+
title: string;
|
|
84
|
+
|
|
85
|
+
@Column({
|
|
86
|
+
type: "enum",
|
|
87
|
+
enum: Purpose_of_Travel,
|
|
88
|
+
default: Purpose_of_Travel.OTHER,
|
|
89
|
+
nullable: false,
|
|
90
|
+
})
|
|
91
|
+
purpose_of_travel: Purpose_of_Travel;
|
|
92
|
+
|
|
93
|
+
@Column({
|
|
94
|
+
type: "enum",
|
|
95
|
+
enum: Type_of_Vehicle,
|
|
96
|
+
default: Type_of_Vehicle.SEDAN,
|
|
97
|
+
nullable: false,
|
|
98
|
+
})
|
|
99
|
+
type_of_vehicle_required: Type_of_Vehicle;
|
|
100
|
+
|
|
101
|
+
@Column({ type: "date", nullable: false })
|
|
102
|
+
date_of_travel: Date;
|
|
103
|
+
|
|
104
|
+
@Column({ type: "time", nullable: true })
|
|
105
|
+
time_of_travel: string;
|
|
106
|
+
|
|
107
|
+
@Column({ type: 'int', nullable: false })
|
|
108
|
+
exp_duration_of_use_hrs: number;
|
|
109
|
+
|
|
110
|
+
@Column({ type: 'int', nullable: false })
|
|
111
|
+
exp_duration_of_use_days: number;
|
|
112
|
+
|
|
113
|
+
@Column({ nullable: false })
|
|
114
|
+
description: string;
|
|
115
|
+
|
|
116
|
+
@Column({
|
|
117
|
+
type: "enum",
|
|
118
|
+
enum: Status,
|
|
119
|
+
default: Status.PENDING,
|
|
120
|
+
nullable: false,
|
|
121
|
+
})
|
|
122
|
+
status: Status;
|
|
123
|
+
|
|
124
|
+
@Column({ type: "varchar", nullable: true })
|
|
125
|
+
workflow_execution_id: string | null;
|
|
126
|
+
|
|
127
|
+
constructor(
|
|
128
|
+
req_user_department_id: number | null,
|
|
129
|
+
req_user_section_id: number | null,
|
|
130
|
+
service_id: number,
|
|
131
|
+
sub_service_id: number,
|
|
132
|
+
user_id: number,
|
|
133
|
+
request_type: Request_Type,
|
|
134
|
+
vehicle_required_for: Vehicle_Required_For,
|
|
135
|
+
vehicle_required_location: Vehicle_Required_Location,
|
|
136
|
+
title: string,
|
|
137
|
+
purpose_of_travel: Purpose_of_Travel,
|
|
138
|
+
type_of_vehicle_required: Type_of_Vehicle,
|
|
139
|
+
date_of_travel: Date,
|
|
140
|
+
time_of_travel: string,
|
|
141
|
+
exp_duration_of_use_hrs: number,
|
|
142
|
+
exp_duration_of_use_days: number,
|
|
143
|
+
description: string,
|
|
144
|
+
status: Status,
|
|
145
|
+
workflow_execution_id?: string | null,
|
|
146
|
+
) {
|
|
147
|
+
super();
|
|
148
|
+
this.req_user_department_id = req_user_department_id ?? null;
|
|
149
|
+
this.req_user_section_id = req_user_section_id ?? null;
|
|
150
|
+
this.service_id = service_id;
|
|
151
|
+
this.sub_service_id = sub_service_id;
|
|
152
|
+
this.user_id = user_id;
|
|
153
|
+
this.request_type = request_type;
|
|
154
|
+
this.vehicle_required_for = vehicle_required_for;
|
|
155
|
+
this.vehicle_required_location = vehicle_required_location;
|
|
156
|
+
this.title = title;
|
|
157
|
+
this.purpose_of_travel = purpose_of_travel;
|
|
158
|
+
this.type_of_vehicle_required = type_of_vehicle_required;
|
|
159
|
+
this.date_of_travel = date_of_travel;
|
|
160
|
+
this.time_of_travel = time_of_travel;
|
|
161
|
+
this.exp_duration_of_use_hrs = exp_duration_of_use_hrs;
|
|
162
|
+
this.exp_duration_of_use_days = exp_duration_of_use_days;
|
|
163
|
+
this.description = description;
|
|
164
|
+
this.status = status;
|
|
165
|
+
this.workflow_execution_id = workflow_execution_id ?? null;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum LogisticsWorkFlowStatus {
|
|
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: 'logistics_workflows' })
|
|
12
|
+
export class LogisticsWorkFlow 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: LogisticsWorkFlowStatus, default: LogisticsWorkFlowStatus.NOT_YET_STARTED, nullable: false })
|
|
20
|
+
status: LogisticsWorkFlowStatus;
|
|
21
|
+
|
|
22
|
+
constructor(request_id: number, content: string, status: LogisticsWorkFlowStatus) {
|
|
23
|
+
super();
|
|
24
|
+
this.request_id = request_id;
|
|
25
|
+
this.content = content;
|
|
26
|
+
this.status = status;
|
|
27
|
+
}
|
|
28
|
+
}
|