@platform-modules/civil-aviation-authority 2.2.1000 → 2.3.1
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 +10 -10
- package/dist/data-source.js +2 -10
- package/dist/index.d.ts +2 -12
- package/dist/index.js +4 -20
- package/dist/models/HrServiceApprovalModel.d.ts +3 -1
- package/dist/models/HrServiceApprovalModel.js +12 -2
- package/dist/models/ITApprovalSettings.d.ts +7 -0
- package/dist/models/ITApprovalSettings.js +40 -0
- package/dist/models/ITServicesTypesMuscatModel.d.ts +6 -0
- package/dist/models/ITServicesTypesMuscatModel.js +34 -0
- package/dist/models/ITServicesTypesSalalahModel.d.ts +6 -0
- package/dist/models/ITServicesTypesSalalahModel.js +34 -0
- package/dist/models/SecondmentRequestModel.d.ts +42 -0
- package/dist/models/SecondmentRequestModel.js +184 -0
- package/dist/models/Workflows.d.ts +9 -0
- package/dist/models/Workflows.js +31 -0
- package/package.json +1 -1
- package/src/data-source.ts +181 -189
- package/src/index.ts +96 -106
- package/src/models/HrServiceApprovalModel.ts +10 -0
- package/src/models/HrServiceRequestModel.ts +167 -167
- package/src/models/ITRequestChatModel.ts +62 -62
- package/src/models/ItApprovalsModel.ts +84 -84
- package/src/models/ItWorkflowModel.ts +55 -55
- package/src/models/SecondmentRequestModel.ts +173 -0
- package/dist/models/StudyLeaveApprovalModel.d.ts +0 -25
- package/dist/models/StudyLeaveApprovalModel.js +0 -107
- package/dist/models/StudyLeaveAttachmentModel.d.ts +0 -13
- package/dist/models/StudyLeaveAttachmentModel.js +0 -69
- package/dist/models/StudyLeaveChatModel.d.ts +0 -26
- package/dist/models/StudyLeaveChatModel.js +0 -89
- package/dist/models/StudyLeaveRequestModel.d.ts +0 -29
- package/dist/models/StudyLeaveRequestModel.js +0 -128
- package/dist/models/StudyLeaveWorkflowModel.d.ts +0 -19
- package/dist/models/StudyLeaveWorkflowModel.js +0 -81
- package/src/models/StudyLeaveApprovalModel.ts +0 -94
- package/src/models/StudyLeaveAttachmentModel.ts +0 -56
- package/src/models/StudyLeaveChatModel.ts +0 -76
- package/src/models/StudyLeaveRequestModel.ts +0 -114
- package/src/models/StudyLeaveWorkflowModel.ts +0 -68
|
@@ -1,167 +1,167 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from "./BaseModel";
|
|
3
|
-
|
|
4
|
-
export enum HrServiceRequestStatus {
|
|
5
|
-
PENDING = "Pending",
|
|
6
|
-
ASSIGNED = "Assigned",
|
|
7
|
-
IN_PROGRESS = "In Progress",
|
|
8
|
-
COMPLETED = "Completed",
|
|
9
|
-
APPROVED = "Approved",
|
|
10
|
-
REJECTED = "Rejected"
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@Entity({ name: "hr_service_requests" })
|
|
14
|
-
export class HrServiceRequest extends BaseModel {
|
|
15
|
-
@Column({ type: "integer", nullable: true })
|
|
16
|
-
req_user_department_id: number | null;
|
|
17
|
-
|
|
18
|
-
@Column({ type: "integer", nullable: true })
|
|
19
|
-
req_user_section_id: number | null;
|
|
20
|
-
|
|
21
|
-
@Column({ type: "integer", nullable: true })
|
|
22
|
-
req_user_position_id: number | null;
|
|
23
|
-
|
|
24
|
-
@Column({ type: "integer", nullable: true })
|
|
25
|
-
service_id: number | null;
|
|
26
|
-
|
|
27
|
-
@Column({ type: "integer", nullable: true })
|
|
28
|
-
sub_service_id: number | null;
|
|
29
|
-
|
|
30
|
-
@Column({ type: "integer", nullable: false })
|
|
31
|
-
user_id: number;
|
|
32
|
-
|
|
33
|
-
@Column({ type: "text", nullable: true })
|
|
34
|
-
description: string | null;
|
|
35
|
-
|
|
36
|
-
@Column({ type: "enum", enum: HrServiceRequestStatus, default: HrServiceRequestStatus.PENDING, nullable: false })
|
|
37
|
-
status: HrServiceRequestStatus;
|
|
38
|
-
|
|
39
|
-
@Column({ type: "integer", nullable: true })
|
|
40
|
-
reviewer_user_id: number | null;
|
|
41
|
-
|
|
42
|
-
@Column({ type: "integer", nullable: true })
|
|
43
|
-
assigned_to_user_id: number | null;
|
|
44
|
-
|
|
45
|
-
@Column({ type: "timestamp", nullable: true })
|
|
46
|
-
assigned_at: Date | null;
|
|
47
|
-
|
|
48
|
-
@Column({ type: "varchar", length: 255, nullable: true })
|
|
49
|
-
workflow_execution_id: string | null;
|
|
50
|
-
|
|
51
|
-
// Assignment Decision specific fields
|
|
52
|
-
@Column({ type: "varchar", length: 255, nullable: false })
|
|
53
|
-
assigned_employee_name: string;
|
|
54
|
-
|
|
55
|
-
@Column({ type: "varchar", length: 50, nullable: true })
|
|
56
|
-
civil_id_card_number: string | null;
|
|
57
|
-
|
|
58
|
-
@Column({ type: "varchar", length: 100, nullable: false })
|
|
59
|
-
employee_id: string;
|
|
60
|
-
|
|
61
|
-
@Column({ type: "varchar", length: 255, nullable: false })
|
|
62
|
-
current_job_position: string;
|
|
63
|
-
|
|
64
|
-
@Column({ type: "varchar", length: 255, nullable: false })
|
|
65
|
-
assigned_job_position: string;
|
|
66
|
-
|
|
67
|
-
@Column({ type: "date", nullable: false })
|
|
68
|
-
start_date: Date;
|
|
69
|
-
|
|
70
|
-
@Column({ type: "date", nullable: false })
|
|
71
|
-
end_date: Date;
|
|
72
|
-
|
|
73
|
-
@Column({ type: "decimal", precision: 5, scale: 2, nullable: true })
|
|
74
|
-
assignment_allowance: number | null; // 0-100 percentage
|
|
75
|
-
|
|
76
|
-
@Column({ type: "varchar", length: 20, nullable: false })
|
|
77
|
-
phone_number: string;
|
|
78
|
-
|
|
79
|
-
@Column({ type: "text", nullable: false })
|
|
80
|
-
reason_for_request: string;
|
|
81
|
-
|
|
82
|
-
// Replacement tracking fields
|
|
83
|
-
@Column({ type: "boolean", default: false, nullable: false })
|
|
84
|
-
is_replaced: boolean;
|
|
85
|
-
|
|
86
|
-
@Column({ type: "varchar", length: 255, nullable: true })
|
|
87
|
-
replacement_employee_name: string | null;
|
|
88
|
-
|
|
89
|
-
@Column({ type: "varchar", length: 100, nullable: true })
|
|
90
|
-
replacement_employee_id: string | null;
|
|
91
|
-
|
|
92
|
-
@Column({ type: "varchar", length: 50, nullable: true })
|
|
93
|
-
replacement_civil_id_card_number: string | null;
|
|
94
|
-
|
|
95
|
-
@Column({ type: "text", nullable: true })
|
|
96
|
-
replacement_reason: string | null;
|
|
97
|
-
|
|
98
|
-
@Column({ type: "integer", nullable: true })
|
|
99
|
-
replaced_by_user_id: number | null;
|
|
100
|
-
|
|
101
|
-
@Column({ type: "timestamp", nullable: true })
|
|
102
|
-
replaced_at: Date | null;
|
|
103
|
-
|
|
104
|
-
constructor(
|
|
105
|
-
user_id: number,
|
|
106
|
-
status: HrServiceRequestStatus = HrServiceRequestStatus.PENDING,
|
|
107
|
-
service_id?: number | null,
|
|
108
|
-
sub_service_id?: number | null,
|
|
109
|
-
req_user_department_id?: number | null,
|
|
110
|
-
req_user_section_id?: number | null,
|
|
111
|
-
req_user_position_id?: number | null,
|
|
112
|
-
description?: string | null,
|
|
113
|
-
reviewer_user_id?: number | null,
|
|
114
|
-
assigned_to_user_id?: number | null,
|
|
115
|
-
assigned_at?: Date | null,
|
|
116
|
-
workflow_execution_id?: string | null,
|
|
117
|
-
assigned_employee_name?: string,
|
|
118
|
-
civil_id_card_number?: string | null,
|
|
119
|
-
employee_id?: string,
|
|
120
|
-
current_job_position?: string,
|
|
121
|
-
assigned_job_position?: string,
|
|
122
|
-
start_date?: Date,
|
|
123
|
-
end_date?: Date,
|
|
124
|
-
assignment_allowance?: number | null,
|
|
125
|
-
phone_number?: string,
|
|
126
|
-
reason_for_request?: string,
|
|
127
|
-
is_replaced?: boolean,
|
|
128
|
-
replacement_employee_name?: string | null,
|
|
129
|
-
replacement_employee_id?: string | null,
|
|
130
|
-
replacement_civil_id_card_number?: string | null,
|
|
131
|
-
replacement_reason?: string | null,
|
|
132
|
-
replaced_by_user_id?: number | null,
|
|
133
|
-
replaced_at?: Date | null
|
|
134
|
-
) {
|
|
135
|
-
super();
|
|
136
|
-
this.user_id = user_id;
|
|
137
|
-
this.status = status;
|
|
138
|
-
this.service_id = service_id || null;
|
|
139
|
-
this.sub_service_id = sub_service_id || null;
|
|
140
|
-
this.req_user_department_id = req_user_department_id || null;
|
|
141
|
-
this.req_user_section_id = req_user_section_id || null;
|
|
142
|
-
this.req_user_position_id = req_user_position_id || null;
|
|
143
|
-
this.description = description || null;
|
|
144
|
-
this.reviewer_user_id = reviewer_user_id || null;
|
|
145
|
-
this.assigned_to_user_id = assigned_to_user_id || null;
|
|
146
|
-
this.assigned_at = assigned_at || null;
|
|
147
|
-
this.workflow_execution_id = workflow_execution_id || null;
|
|
148
|
-
this.assigned_employee_name = assigned_employee_name || "";
|
|
149
|
-
this.civil_id_card_number = civil_id_card_number || null;
|
|
150
|
-
this.employee_id = employee_id || "";
|
|
151
|
-
this.current_job_position = current_job_position || "";
|
|
152
|
-
this.assigned_job_position = assigned_job_position || "";
|
|
153
|
-
this.start_date = start_date || new Date();
|
|
154
|
-
this.end_date = end_date || new Date();
|
|
155
|
-
this.assignment_allowance = assignment_allowance || null;
|
|
156
|
-
this.phone_number = phone_number || "";
|
|
157
|
-
this.reason_for_request = reason_for_request || "";
|
|
158
|
-
this.is_replaced = is_replaced || false;
|
|
159
|
-
this.replacement_employee_name = replacement_employee_name || null;
|
|
160
|
-
this.replacement_employee_id = replacement_employee_id || null;
|
|
161
|
-
this.replacement_civil_id_card_number = replacement_civil_id_card_number || null;
|
|
162
|
-
this.replacement_reason = replacement_reason || null;
|
|
163
|
-
this.replaced_by_user_id = replaced_by_user_id || null;
|
|
164
|
-
this.replaced_at = replaced_at || null;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
export enum HrServiceRequestStatus {
|
|
5
|
+
PENDING = "Pending",
|
|
6
|
+
ASSIGNED = "Assigned",
|
|
7
|
+
IN_PROGRESS = "In Progress",
|
|
8
|
+
COMPLETED = "Completed",
|
|
9
|
+
APPROVED = "Approved",
|
|
10
|
+
REJECTED = "Rejected"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@Entity({ name: "hr_service_requests" })
|
|
14
|
+
export class HrServiceRequest extends BaseModel {
|
|
15
|
+
@Column({ type: "integer", nullable: true })
|
|
16
|
+
req_user_department_id: number | null;
|
|
17
|
+
|
|
18
|
+
@Column({ type: "integer", nullable: true })
|
|
19
|
+
req_user_section_id: number | null;
|
|
20
|
+
|
|
21
|
+
@Column({ type: "integer", nullable: true })
|
|
22
|
+
req_user_position_id: number | null;
|
|
23
|
+
|
|
24
|
+
@Column({ type: "integer", nullable: true })
|
|
25
|
+
service_id: number | null;
|
|
26
|
+
|
|
27
|
+
@Column({ type: "integer", nullable: true })
|
|
28
|
+
sub_service_id: number | null;
|
|
29
|
+
|
|
30
|
+
@Column({ type: "integer", nullable: false })
|
|
31
|
+
user_id: number;
|
|
32
|
+
|
|
33
|
+
@Column({ type: "text", nullable: true })
|
|
34
|
+
description: string | null;
|
|
35
|
+
|
|
36
|
+
@Column({ type: "enum", enum: HrServiceRequestStatus, default: HrServiceRequestStatus.PENDING, nullable: false })
|
|
37
|
+
status: HrServiceRequestStatus;
|
|
38
|
+
|
|
39
|
+
@Column({ type: "integer", nullable: true })
|
|
40
|
+
reviewer_user_id: number | null;
|
|
41
|
+
|
|
42
|
+
@Column({ type: "integer", nullable: true })
|
|
43
|
+
assigned_to_user_id: number | null;
|
|
44
|
+
|
|
45
|
+
@Column({ type: "timestamp", nullable: true })
|
|
46
|
+
assigned_at: Date | null;
|
|
47
|
+
|
|
48
|
+
@Column({ type: "varchar", length: 255, nullable: true })
|
|
49
|
+
workflow_execution_id: string | null;
|
|
50
|
+
|
|
51
|
+
// Assignment Decision specific fields
|
|
52
|
+
@Column({ type: "varchar", length: 255, nullable: false })
|
|
53
|
+
assigned_employee_name: string;
|
|
54
|
+
|
|
55
|
+
@Column({ type: "varchar", length: 50, nullable: true })
|
|
56
|
+
civil_id_card_number: string | null;
|
|
57
|
+
|
|
58
|
+
@Column({ type: "varchar", length: 100, nullable: false })
|
|
59
|
+
employee_id: string;
|
|
60
|
+
|
|
61
|
+
@Column({ type: "varchar", length: 255, nullable: false })
|
|
62
|
+
current_job_position: string;
|
|
63
|
+
|
|
64
|
+
@Column({ type: "varchar", length: 255, nullable: false })
|
|
65
|
+
assigned_job_position: string;
|
|
66
|
+
|
|
67
|
+
@Column({ type: "date", nullable: false })
|
|
68
|
+
start_date: Date;
|
|
69
|
+
|
|
70
|
+
@Column({ type: "date", nullable: false })
|
|
71
|
+
end_date: Date;
|
|
72
|
+
|
|
73
|
+
@Column({ type: "decimal", precision: 5, scale: 2, nullable: true })
|
|
74
|
+
assignment_allowance: number | null; // 0-100 percentage
|
|
75
|
+
|
|
76
|
+
@Column({ type: "varchar", length: 20, nullable: false })
|
|
77
|
+
phone_number: string;
|
|
78
|
+
|
|
79
|
+
@Column({ type: "text", nullable: false })
|
|
80
|
+
reason_for_request: string;
|
|
81
|
+
|
|
82
|
+
// Replacement tracking fields
|
|
83
|
+
@Column({ type: "boolean", default: false, nullable: false })
|
|
84
|
+
is_replaced: boolean;
|
|
85
|
+
|
|
86
|
+
@Column({ type: "varchar", length: 255, nullable: true })
|
|
87
|
+
replacement_employee_name: string | null;
|
|
88
|
+
|
|
89
|
+
@Column({ type: "varchar", length: 100, nullable: true })
|
|
90
|
+
replacement_employee_id: string | null;
|
|
91
|
+
|
|
92
|
+
@Column({ type: "varchar", length: 50, nullable: true })
|
|
93
|
+
replacement_civil_id_card_number: string | null;
|
|
94
|
+
|
|
95
|
+
@Column({ type: "text", nullable: true })
|
|
96
|
+
replacement_reason: string | null;
|
|
97
|
+
|
|
98
|
+
@Column({ type: "integer", nullable: true })
|
|
99
|
+
replaced_by_user_id: number | null;
|
|
100
|
+
|
|
101
|
+
@Column({ type: "timestamp", nullable: true })
|
|
102
|
+
replaced_at: Date | null;
|
|
103
|
+
|
|
104
|
+
constructor(
|
|
105
|
+
user_id: number,
|
|
106
|
+
status: HrServiceRequestStatus = HrServiceRequestStatus.PENDING,
|
|
107
|
+
service_id?: number | null,
|
|
108
|
+
sub_service_id?: number | null,
|
|
109
|
+
req_user_department_id?: number | null,
|
|
110
|
+
req_user_section_id?: number | null,
|
|
111
|
+
req_user_position_id?: number | null,
|
|
112
|
+
description?: string | null,
|
|
113
|
+
reviewer_user_id?: number | null,
|
|
114
|
+
assigned_to_user_id?: number | null,
|
|
115
|
+
assigned_at?: Date | null,
|
|
116
|
+
workflow_execution_id?: string | null,
|
|
117
|
+
assigned_employee_name?: string,
|
|
118
|
+
civil_id_card_number?: string | null,
|
|
119
|
+
employee_id?: string,
|
|
120
|
+
current_job_position?: string,
|
|
121
|
+
assigned_job_position?: string,
|
|
122
|
+
start_date?: Date,
|
|
123
|
+
end_date?: Date,
|
|
124
|
+
assignment_allowance?: number | null,
|
|
125
|
+
phone_number?: string,
|
|
126
|
+
reason_for_request?: string,
|
|
127
|
+
is_replaced?: boolean,
|
|
128
|
+
replacement_employee_name?: string | null,
|
|
129
|
+
replacement_employee_id?: string | null,
|
|
130
|
+
replacement_civil_id_card_number?: string | null,
|
|
131
|
+
replacement_reason?: string | null,
|
|
132
|
+
replaced_by_user_id?: number | null,
|
|
133
|
+
replaced_at?: Date | null
|
|
134
|
+
) {
|
|
135
|
+
super();
|
|
136
|
+
this.user_id = user_id;
|
|
137
|
+
this.status = status;
|
|
138
|
+
this.service_id = service_id || null;
|
|
139
|
+
this.sub_service_id = sub_service_id || null;
|
|
140
|
+
this.req_user_department_id = req_user_department_id || null;
|
|
141
|
+
this.req_user_section_id = req_user_section_id || null;
|
|
142
|
+
this.req_user_position_id = req_user_position_id || null;
|
|
143
|
+
this.description = description || null;
|
|
144
|
+
this.reviewer_user_id = reviewer_user_id || null;
|
|
145
|
+
this.assigned_to_user_id = assigned_to_user_id || null;
|
|
146
|
+
this.assigned_at = assigned_at || null;
|
|
147
|
+
this.workflow_execution_id = workflow_execution_id || null;
|
|
148
|
+
this.assigned_employee_name = assigned_employee_name || "";
|
|
149
|
+
this.civil_id_card_number = civil_id_card_number || null;
|
|
150
|
+
this.employee_id = employee_id || "";
|
|
151
|
+
this.current_job_position = current_job_position || "";
|
|
152
|
+
this.assigned_job_position = assigned_job_position || "";
|
|
153
|
+
this.start_date = start_date || new Date();
|
|
154
|
+
this.end_date = end_date || new Date();
|
|
155
|
+
this.assignment_allowance = assignment_allowance || null;
|
|
156
|
+
this.phone_number = phone_number || "";
|
|
157
|
+
this.reason_for_request = reason_for_request || "";
|
|
158
|
+
this.is_replaced = is_replaced || false;
|
|
159
|
+
this.replacement_employee_name = replacement_employee_name || null;
|
|
160
|
+
this.replacement_employee_id = replacement_employee_id || null;
|
|
161
|
+
this.replacement_civil_id_card_number = replacement_civil_id_card_number || null;
|
|
162
|
+
this.replacement_reason = replacement_reason || null;
|
|
163
|
+
this.replaced_by_user_id = replaced_by_user_id || null;
|
|
164
|
+
this.replaced_at = replaced_at || null;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
@@ -1,62 +1,62 @@
|
|
|
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: true })
|
|
17
|
-
service_id: number | null;
|
|
18
|
-
|
|
19
|
-
@Column({ type: 'integer', nullable: true })
|
|
20
|
-
sub_service_id: number | null;
|
|
21
|
-
|
|
22
|
-
@Column({ type: 'integer', nullable: false })
|
|
23
|
-
user_id: number;
|
|
24
|
-
|
|
25
|
-
@ManyToOne(() => User)
|
|
26
|
-
@JoinColumn({ name: 'user_id' })
|
|
27
|
-
user: User;
|
|
28
|
-
|
|
29
|
-
@Column({ type: 'integer', nullable: true })
|
|
30
|
-
role_id: number | null;
|
|
31
|
-
|
|
32
|
-
@Column({ type: 'text', nullable: false })
|
|
33
|
-
message: string;
|
|
34
|
-
|
|
35
|
-
@Column({ type: 'text', nullable: true })
|
|
36
|
-
status: string | null;
|
|
37
|
-
|
|
38
|
-
@Column({ type: 'boolean', default: false })
|
|
39
|
-
is_internal: boolean;
|
|
40
|
-
|
|
41
|
-
constructor(
|
|
42
|
-
request_id: number,
|
|
43
|
-
user_id: number,
|
|
44
|
-
message: string,
|
|
45
|
-
is_internal?: boolean,
|
|
46
|
-
service_id?: number | null,
|
|
47
|
-
sub_service_id?: number | null,
|
|
48
|
-
role_id?: number | null,
|
|
49
|
-
status?: string | null
|
|
50
|
-
) {
|
|
51
|
-
super();
|
|
52
|
-
this.request_id = request_id;
|
|
53
|
-
this.service_id = service_id || null;
|
|
54
|
-
this.sub_service_id = sub_service_id || null;
|
|
55
|
-
this.user_id = user_id;
|
|
56
|
-
this.role_id = role_id || null;
|
|
57
|
-
this.message = message;
|
|
58
|
-
this.status = status || null;
|
|
59
|
-
this.is_internal = is_internal || false;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
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: true })
|
|
17
|
+
service_id: number | null;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'integer', nullable: true })
|
|
20
|
+
sub_service_id: number | null;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'integer', nullable: false })
|
|
23
|
+
user_id: number;
|
|
24
|
+
|
|
25
|
+
@ManyToOne(() => User)
|
|
26
|
+
@JoinColumn({ name: 'user_id' })
|
|
27
|
+
user: User;
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'integer', nullable: true })
|
|
30
|
+
role_id: number | null;
|
|
31
|
+
|
|
32
|
+
@Column({ type: 'text', nullable: false })
|
|
33
|
+
message: string;
|
|
34
|
+
|
|
35
|
+
@Column({ type: 'text', nullable: true })
|
|
36
|
+
status: string | null;
|
|
37
|
+
|
|
38
|
+
@Column({ type: 'boolean', default: false })
|
|
39
|
+
is_internal: boolean;
|
|
40
|
+
|
|
41
|
+
constructor(
|
|
42
|
+
request_id: number,
|
|
43
|
+
user_id: number,
|
|
44
|
+
message: string,
|
|
45
|
+
is_internal?: boolean,
|
|
46
|
+
service_id?: number | null,
|
|
47
|
+
sub_service_id?: number | null,
|
|
48
|
+
role_id?: number | null,
|
|
49
|
+
status?: string | null
|
|
50
|
+
) {
|
|
51
|
+
super();
|
|
52
|
+
this.request_id = request_id;
|
|
53
|
+
this.service_id = service_id || null;
|
|
54
|
+
this.sub_service_id = sub_service_id || null;
|
|
55
|
+
this.user_id = user_id;
|
|
56
|
+
this.role_id = role_id || null;
|
|
57
|
+
this.message = message;
|
|
58
|
+
this.status = status || null;
|
|
59
|
+
this.is_internal = is_internal || false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
@@ -1,85 +1,85 @@
|
|
|
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
|
-
ASSIGNED = "Assigned",
|
|
10
|
-
REASSIGNED = "Reassigned"
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@Entity({ name: 'it_approvals' })
|
|
15
|
-
export class ItApprovalDetails extends BaseModel {
|
|
16
|
-
@Column({ type: 'integer', nullable: false })
|
|
17
|
-
request_id: number;
|
|
18
|
-
|
|
19
|
-
@Column({ type: 'integer', nullable: true })
|
|
20
|
-
service_id: number | null;
|
|
21
|
-
|
|
22
|
-
@Column({ type: 'integer', nullable: true })
|
|
23
|
-
sub_service_id: number | null;
|
|
24
|
-
|
|
25
|
-
@Column({ type: 'integer', nullable: false })
|
|
26
|
-
level: number;
|
|
27
|
-
|
|
28
|
-
@Column({ type: 'integer', nullable: true })
|
|
29
|
-
approver_user_id: number | null;
|
|
30
|
-
|
|
31
|
-
@Column({ type: 'integer', nullable: true })
|
|
32
|
-
delegation_user_id: number | null;
|
|
33
|
-
|
|
34
|
-
@Column({ type: 'integer', nullable: false })
|
|
35
|
-
approver_role_id: number | null;
|
|
36
|
-
|
|
37
|
-
@Column({ type: 'integer', nullable: true })
|
|
38
|
-
department_id: number | null;
|
|
39
|
-
|
|
40
|
-
@Column({ type: 'integer', nullable: true })
|
|
41
|
-
section_id: number | null;
|
|
42
|
-
|
|
43
|
-
@Column({ type: 'integer', nullable: true })
|
|
44
|
-
approved_by: number | null;
|
|
45
|
-
|
|
46
|
-
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
47
|
-
comment: string;
|
|
48
|
-
|
|
49
|
-
@Column({ type: 'enum', enum: ApprovalStatus,default: ApprovalStatus.PENDING, nullable: false })
|
|
50
|
-
approval_status: ApprovalStatus;
|
|
51
|
-
|
|
52
|
-
@Column({ type: 'boolean', default: true, nullable: false })
|
|
53
|
-
is_allowed: boolean;
|
|
54
|
-
|
|
55
|
-
constructor(
|
|
56
|
-
request_id: number,
|
|
57
|
-
approver_user_id: number | null,
|
|
58
|
-
approver_role_id: number | null,
|
|
59
|
-
comment: string,
|
|
60
|
-
approval_status: ApprovalStatus,
|
|
61
|
-
level: number,
|
|
62
|
-
department_id?: number | null,
|
|
63
|
-
section_id?: number | null,
|
|
64
|
-
approved_by?: number | null,
|
|
65
|
-
service_id?: number | null,
|
|
66
|
-
sub_service_id?: number | null,
|
|
67
|
-
delegation_user_id?: number | null,
|
|
68
|
-
is_allowed?: boolean
|
|
69
|
-
) {
|
|
70
|
-
super();
|
|
71
|
-
this.request_id = request_id;
|
|
72
|
-
this.approver_user_id = approver_user_id;
|
|
73
|
-
this.approver_role_id = approver_role_id;
|
|
74
|
-
this.comment = comment;
|
|
75
|
-
this.approval_status = approval_status;
|
|
76
|
-
this.level = level;
|
|
77
|
-
this.department_id = department_id || null;
|
|
78
|
-
this.section_id = section_id || null;
|
|
79
|
-
this.approved_by = approved_by || null;
|
|
80
|
-
this.service_id = service_id ?? null;
|
|
81
|
-
this.sub_service_id = sub_service_id ?? null;
|
|
82
|
-
this.delegation_user_id = delegation_user_id || null;
|
|
83
|
-
this.is_allowed = is_allowed ?? true;
|
|
84
|
-
}
|
|
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
|
+
ASSIGNED = "Assigned",
|
|
10
|
+
REASSIGNED = "Reassigned"
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@Entity({ name: 'it_approvals' })
|
|
15
|
+
export class ItApprovalDetails extends BaseModel {
|
|
16
|
+
@Column({ type: 'integer', nullable: false })
|
|
17
|
+
request_id: number;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'integer', nullable: true })
|
|
20
|
+
service_id: number | null;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'integer', nullable: true })
|
|
23
|
+
sub_service_id: number | null;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'integer', nullable: false })
|
|
26
|
+
level: number;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'integer', nullable: true })
|
|
29
|
+
approver_user_id: number | null;
|
|
30
|
+
|
|
31
|
+
@Column({ type: 'integer', nullable: true })
|
|
32
|
+
delegation_user_id: number | null;
|
|
33
|
+
|
|
34
|
+
@Column({ type: 'integer', nullable: false })
|
|
35
|
+
approver_role_id: number | null;
|
|
36
|
+
|
|
37
|
+
@Column({ type: 'integer', nullable: true })
|
|
38
|
+
department_id: number | null;
|
|
39
|
+
|
|
40
|
+
@Column({ type: 'integer', nullable: true })
|
|
41
|
+
section_id: number | null;
|
|
42
|
+
|
|
43
|
+
@Column({ type: 'integer', nullable: true })
|
|
44
|
+
approved_by: number | null;
|
|
45
|
+
|
|
46
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
47
|
+
comment: string;
|
|
48
|
+
|
|
49
|
+
@Column({ type: 'enum', enum: ApprovalStatus,default: ApprovalStatus.PENDING, nullable: false })
|
|
50
|
+
approval_status: ApprovalStatus;
|
|
51
|
+
|
|
52
|
+
@Column({ type: 'boolean', default: true, nullable: false })
|
|
53
|
+
is_allowed: boolean;
|
|
54
|
+
|
|
55
|
+
constructor(
|
|
56
|
+
request_id: number,
|
|
57
|
+
approver_user_id: number | null,
|
|
58
|
+
approver_role_id: number | null,
|
|
59
|
+
comment: string,
|
|
60
|
+
approval_status: ApprovalStatus,
|
|
61
|
+
level: number,
|
|
62
|
+
department_id?: number | null,
|
|
63
|
+
section_id?: number | null,
|
|
64
|
+
approved_by?: number | null,
|
|
65
|
+
service_id?: number | null,
|
|
66
|
+
sub_service_id?: number | null,
|
|
67
|
+
delegation_user_id?: number | null,
|
|
68
|
+
is_allowed?: boolean
|
|
69
|
+
) {
|
|
70
|
+
super();
|
|
71
|
+
this.request_id = request_id;
|
|
72
|
+
this.approver_user_id = approver_user_id;
|
|
73
|
+
this.approver_role_id = approver_role_id;
|
|
74
|
+
this.comment = comment;
|
|
75
|
+
this.approval_status = approval_status;
|
|
76
|
+
this.level = level;
|
|
77
|
+
this.department_id = department_id || null;
|
|
78
|
+
this.section_id = section_id || null;
|
|
79
|
+
this.approved_by = approved_by || null;
|
|
80
|
+
this.service_id = service_id ?? null;
|
|
81
|
+
this.sub_service_id = sub_service_id ?? null;
|
|
82
|
+
this.delegation_user_id = delegation_user_id || null;
|
|
83
|
+
this.is_allowed = is_allowed ?? true;
|
|
84
|
+
}
|
|
85
85
|
}
|