@platform-modules/civil-aviation-authority 2.3.12 → 2.3.14
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 +14 -9
- package/dist/data-source.js +31 -1
- package/dist/index.d.ts +35 -8
- package/dist/index.js +59 -9
- package/dist/models/AnnualTrainingPlanApprovalModel.d.ts +25 -0
- package/dist/models/AnnualTrainingPlanApprovalModel.js +107 -0
- package/dist/models/AnnualTrainingPlanAttachmentModel.d.ts +13 -0
- package/dist/models/AnnualTrainingPlanAttachmentModel.js +69 -0
- package/dist/models/AnnualTrainingPlanChatModel.d.ts +26 -0
- package/dist/models/AnnualTrainingPlanChatModel.js +89 -0
- package/dist/models/AnnualTrainingPlanRequestModel.d.ts +36 -0
- package/dist/models/AnnualTrainingPlanRequestModel.js +151 -0
- package/dist/models/AnnualTrainingPlanWorkflowModel.d.ts +19 -0
- package/dist/models/AnnualTrainingPlanWorkflowModel.js +81 -0
- package/dist/models/AssignTasksEmpApprovalModel.d.ts +23 -0
- package/dist/models/AssignTasksEmpApprovalModel.js +96 -0
- package/dist/models/AssignTasksEmpAttachmentModel.d.ts +12 -0
- package/dist/models/AssignTasksEmpAttachmentModel.js +64 -0
- package/dist/models/AssignTasksEmpChatModel.d.ts +19 -0
- package/dist/models/AssignTasksEmpChatModel.js +77 -0
- package/dist/models/AssignTasksEmpRequestModel.d.ts +25 -0
- package/dist/models/AssignTasksEmpRequestModel.js +100 -0
- package/dist/models/AssignTasksEmpWorkflowModel.d.ts +18 -0
- package/dist/models/AssignTasksEmpWorkflowModel.js +76 -0
- package/dist/models/TrainingRoomBookingApprovalModel.d.ts +25 -0
- package/dist/models/TrainingRoomBookingApprovalModel.js +107 -0
- package/dist/models/TrainingRoomBookingAttachmentModel.d.ts +13 -0
- package/dist/models/TrainingRoomBookingAttachmentModel.js +69 -0
- package/dist/models/TrainingRoomBookingChatModel.d.ts +26 -0
- package/dist/models/TrainingRoomBookingChatModel.js +89 -0
- package/dist/models/TrainingRoomBookingRequestModel.d.ts +38 -0
- package/dist/models/TrainingRoomBookingRequestModel.js +149 -0
- package/dist/models/TrainingRoomBookingWorkflowModel.d.ts +19 -0
- package/dist/models/TrainingRoomBookingWorkflowModel.js +81 -0
- package/dist/models/Workflows.d.ts +0 -9
- package/package.json +1 -1
- package/src/data-source.ts +31 -1
- package/src/index.ts +35 -8
- package/src/models/AnnualTrainingPlanApprovalModel.ts +94 -0
- package/src/models/AnnualTrainingPlanAttachmentModel.ts +56 -0
- package/src/models/AnnualTrainingPlanChatModel.ts +76 -0
- package/src/models/AnnualTrainingPlanRequestModel.ts +138 -0
- package/src/models/AnnualTrainingPlanWorkflowModel.ts +68 -0
- package/src/models/AssignTasksEmpApprovalModel.ts +84 -0
- package/src/models/AssignTasksEmpAttachmentModel.ts +52 -0
- package/src/models/AssignTasksEmpChatModel.ts +65 -0
- package/src/models/AssignTasksEmpRequestModel.ts +90 -0
- package/src/models/AssignTasksEmpWorkflowModel.ts +63 -0
- package/src/models/HrServiceRequestModel.ts +167 -167
- package/src/models/TrainingRoomBookingApprovalModel.ts +94 -0
- package/src/models/TrainingRoomBookingAttachmentModel.ts +56 -0
- package/src/models/TrainingRoomBookingChatModel.ts +76 -0
- package/src/models/TrainingRoomBookingRequestModel.ts +136 -0
- package/src/models/TrainingRoomBookingWorkflowModel.ts +68 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
export enum AnnualTrainingPlanRequestStatus {
|
|
5
|
+
PENDING = "Pending",
|
|
6
|
+
IN_PROGRESS = "In Progress",
|
|
7
|
+
COMPLETED = "Completed",
|
|
8
|
+
APPROVED = "Approved",
|
|
9
|
+
REJECTED = "Rejected"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export enum AnnualTrainingPlanPlace {
|
|
13
|
+
INSIDE = "Inside",
|
|
14
|
+
OUTSIDE = "Outside"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@Entity({ name: "annual_training_plan_requests" })
|
|
18
|
+
export class AnnualTrainingPlanRequest extends BaseModel {
|
|
19
|
+
@Column({ type: "integer", nullable: true })
|
|
20
|
+
req_user_department_id: number | null;
|
|
21
|
+
|
|
22
|
+
@Column({ type: "integer", nullable: true })
|
|
23
|
+
req_user_section_id: number | null;
|
|
24
|
+
|
|
25
|
+
@Column({ type: "integer", nullable: true })
|
|
26
|
+
req_user_position_id: number | null;
|
|
27
|
+
|
|
28
|
+
@Column({ type: "integer", nullable: true })
|
|
29
|
+
service_id: number | null;
|
|
30
|
+
|
|
31
|
+
@Column({ type: "integer", nullable: true })
|
|
32
|
+
sub_service_id: number | null;
|
|
33
|
+
|
|
34
|
+
@Column({ type: "integer", nullable: false })
|
|
35
|
+
user_id: number;
|
|
36
|
+
|
|
37
|
+
@Column({ type: "varchar", length: 255, nullable: false })
|
|
38
|
+
course_name: string;
|
|
39
|
+
|
|
40
|
+
@Column({ type: "integer", nullable: false })
|
|
41
|
+
no_of_participants: number;
|
|
42
|
+
|
|
43
|
+
@Column({ type: "decimal", precision: 10, scale: 2, nullable: false })
|
|
44
|
+
course_cost: number;
|
|
45
|
+
|
|
46
|
+
@Column({ type: "decimal", precision: 10, scale: 2, nullable: false })
|
|
47
|
+
total_cost: number;
|
|
48
|
+
|
|
49
|
+
@Column({ type: "date", nullable: false })
|
|
50
|
+
proposed_implementation_date: Date;
|
|
51
|
+
|
|
52
|
+
@Column({ type: "text", nullable: false })
|
|
53
|
+
description: string;
|
|
54
|
+
|
|
55
|
+
@Column({
|
|
56
|
+
type: "enum",
|
|
57
|
+
enum: AnnualTrainingPlanPlace,
|
|
58
|
+
nullable: false
|
|
59
|
+
})
|
|
60
|
+
place: AnnualTrainingPlanPlace;
|
|
61
|
+
|
|
62
|
+
@Column({ type: "varchar", length: 255, nullable: true })
|
|
63
|
+
location: string | null;
|
|
64
|
+
|
|
65
|
+
@Column({ type: "text", nullable: false })
|
|
66
|
+
reason: string;
|
|
67
|
+
|
|
68
|
+
@Column({ type: "jsonb", nullable: true })
|
|
69
|
+
employee_list: any[] | null; // List of employees for training attendance
|
|
70
|
+
|
|
71
|
+
@Column({
|
|
72
|
+
type: "enum",
|
|
73
|
+
enum: AnnualTrainingPlanRequestStatus,
|
|
74
|
+
default: AnnualTrainingPlanRequestStatus.PENDING,
|
|
75
|
+
nullable: false
|
|
76
|
+
})
|
|
77
|
+
status: AnnualTrainingPlanRequestStatus;
|
|
78
|
+
|
|
79
|
+
@Column({ type: "integer", nullable: true })
|
|
80
|
+
reviewer_user_id: number | null;
|
|
81
|
+
|
|
82
|
+
@Column({ type: "integer", nullable: true })
|
|
83
|
+
assigned_to_user_id: number | null;
|
|
84
|
+
|
|
85
|
+
@Column({ type: "timestamp", nullable: true })
|
|
86
|
+
assigned_at: Date | null;
|
|
87
|
+
|
|
88
|
+
@Column({ type: "varchar", length: 255, nullable: true })
|
|
89
|
+
workflow_execution_id: string | null;
|
|
90
|
+
|
|
91
|
+
constructor(
|
|
92
|
+
user_id: number,
|
|
93
|
+
course_name: string,
|
|
94
|
+
no_of_participants: number,
|
|
95
|
+
course_cost: number,
|
|
96
|
+
total_cost: number,
|
|
97
|
+
proposed_implementation_date: Date,
|
|
98
|
+
description: string,
|
|
99
|
+
place: AnnualTrainingPlanPlace,
|
|
100
|
+
reason: string,
|
|
101
|
+
status: AnnualTrainingPlanRequestStatus = AnnualTrainingPlanRequestStatus.PENDING,
|
|
102
|
+
service_id?: number | null,
|
|
103
|
+
sub_service_id?: number | null,
|
|
104
|
+
req_user_department_id?: number | null,
|
|
105
|
+
req_user_section_id?: number | null,
|
|
106
|
+
req_user_position_id?: number | null,
|
|
107
|
+
location?: string | null,
|
|
108
|
+
employee_list?: any[] | null,
|
|
109
|
+
reviewer_user_id?: number | null,
|
|
110
|
+
assigned_to_user_id?: number | null,
|
|
111
|
+
assigned_at?: Date | null,
|
|
112
|
+
workflow_execution_id?: string | null
|
|
113
|
+
) {
|
|
114
|
+
super();
|
|
115
|
+
this.user_id = user_id;
|
|
116
|
+
this.course_name = course_name;
|
|
117
|
+
this.no_of_participants = no_of_participants;
|
|
118
|
+
this.course_cost = course_cost;
|
|
119
|
+
this.total_cost = total_cost;
|
|
120
|
+
this.proposed_implementation_date = proposed_implementation_date;
|
|
121
|
+
this.description = description;
|
|
122
|
+
this.place = place;
|
|
123
|
+
this.reason = reason;
|
|
124
|
+
this.status = status;
|
|
125
|
+
this.service_id = service_id || null;
|
|
126
|
+
this.sub_service_id = sub_service_id || null;
|
|
127
|
+
this.req_user_department_id = req_user_department_id || null;
|
|
128
|
+
this.req_user_section_id = req_user_section_id || null;
|
|
129
|
+
this.req_user_position_id = req_user_position_id || null;
|
|
130
|
+
this.location = location || null;
|
|
131
|
+
this.employee_list = employee_list || null;
|
|
132
|
+
this.reviewer_user_id = reviewer_user_id || null;
|
|
133
|
+
this.assigned_to_user_id = assigned_to_user_id || null;
|
|
134
|
+
this.assigned_at = assigned_at || null;
|
|
135
|
+
this.workflow_execution_id = workflow_execution_id || null;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
export enum AnnualTrainingPlanWorkFlowStatus {
|
|
5
|
+
COMPLETED = "Completed",
|
|
6
|
+
NOT_YET_STARTED = "Not Yet Started",
|
|
7
|
+
PENDING = "Pending",
|
|
8
|
+
REJECTED = "Rejected"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Entity({ name: "annual_training_plan_workflows" })
|
|
12
|
+
export class AnnualTrainingPlanWorkFlow extends BaseModel {
|
|
13
|
+
@Column({ type: "int", nullable: false })
|
|
14
|
+
request_id: number;
|
|
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: "int", nullable: true })
|
|
23
|
+
order: number | null;
|
|
24
|
+
|
|
25
|
+
@Column({ type: "varchar", length: 255, nullable: false })
|
|
26
|
+
content: string;
|
|
27
|
+
|
|
28
|
+
@Column({ type: "integer", nullable: true })
|
|
29
|
+
approver_role_id: number | null;
|
|
30
|
+
|
|
31
|
+
@Column({ type: "integer", nullable: true })
|
|
32
|
+
approver_user_id: number | null;
|
|
33
|
+
|
|
34
|
+
@Column({ type: "integer", nullable: true })
|
|
35
|
+
approved_by: number | null;
|
|
36
|
+
|
|
37
|
+
@Column({
|
|
38
|
+
type: "enum",
|
|
39
|
+
enum: AnnualTrainingPlanWorkFlowStatus,
|
|
40
|
+
default: AnnualTrainingPlanWorkFlowStatus.PENDING,
|
|
41
|
+
nullable: false
|
|
42
|
+
})
|
|
43
|
+
status: AnnualTrainingPlanWorkFlowStatus;
|
|
44
|
+
|
|
45
|
+
constructor(
|
|
46
|
+
request_id: number,
|
|
47
|
+
content: string,
|
|
48
|
+
status: AnnualTrainingPlanWorkFlowStatus,
|
|
49
|
+
service_id?: number | null,
|
|
50
|
+
sub_service_id?: number | null,
|
|
51
|
+
order?: number,
|
|
52
|
+
approver_role_id?: number | null,
|
|
53
|
+
approver_user_id?: number | null,
|
|
54
|
+
approved_by?: number | null
|
|
55
|
+
) {
|
|
56
|
+
super();
|
|
57
|
+
this.request_id = request_id;
|
|
58
|
+
this.service_id = service_id || null;
|
|
59
|
+
this.sub_service_id = sub_service_id || null;
|
|
60
|
+
this.content = content;
|
|
61
|
+
this.status = status;
|
|
62
|
+
this.order = order || null;
|
|
63
|
+
this.approver_role_id = approver_role_id || null;
|
|
64
|
+
this.approver_user_id = approver_user_id || null;
|
|
65
|
+
this.approved_by = approved_by || null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export enum AssignTasksEmpApprovalStatus {
|
|
6
|
+
PENDING = "Pending",
|
|
7
|
+
IN_PROGRESS = "In Progress",
|
|
8
|
+
APPROVED = "Approved",
|
|
9
|
+
REJECTED = "Rejected"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Entity({ name: 'assign_tasks_emp_approvals' })
|
|
13
|
+
export class AssignTasksEmpApprovalDetails extends BaseModel {
|
|
14
|
+
@Column({ type: 'integer', nullable: false })
|
|
15
|
+
request_id: number;
|
|
16
|
+
|
|
17
|
+
@Column({ type: 'integer', nullable: true })
|
|
18
|
+
service_id: number | null;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'integer', nullable: true })
|
|
21
|
+
sub_service_id: number | null;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'integer', nullable: false })
|
|
24
|
+
level: number;
|
|
25
|
+
|
|
26
|
+
@Column({ type: 'integer', nullable: true })
|
|
27
|
+
approver_role_id: number;
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'integer', nullable: true })
|
|
30
|
+
department_id: number | null;
|
|
31
|
+
|
|
32
|
+
@Column({ type: 'integer', nullable: true })
|
|
33
|
+
section_id: number | null;
|
|
34
|
+
|
|
35
|
+
@Column({ type: 'integer', nullable: true })
|
|
36
|
+
approver_user_id: number | null;
|
|
37
|
+
|
|
38
|
+
@Column({ type: 'integer', nullable: true })
|
|
39
|
+
delegate_user_id: number | null;
|
|
40
|
+
|
|
41
|
+
@Column({ type: 'integer', nullable: true })
|
|
42
|
+
approved_by: number | null;
|
|
43
|
+
|
|
44
|
+
@Column({ type: 'varchar', length: 500, nullable: true, default: '' })
|
|
45
|
+
comment: string;
|
|
46
|
+
|
|
47
|
+
@Column({ type: 'enum', enum: AssignTasksEmpApprovalStatus, default: AssignTasksEmpApprovalStatus.PENDING, nullable: false })
|
|
48
|
+
approval_status: AssignTasksEmpApprovalStatus;
|
|
49
|
+
|
|
50
|
+
@Column({ type: 'boolean', default: true, nullable: false })
|
|
51
|
+
is_allowed: boolean;
|
|
52
|
+
|
|
53
|
+
constructor(
|
|
54
|
+
request_id: number,
|
|
55
|
+
approver_role_id: number,
|
|
56
|
+
comment: string,
|
|
57
|
+
approval_status: AssignTasksEmpApprovalStatus,
|
|
58
|
+
level: number,
|
|
59
|
+
department_id?: number | null,
|
|
60
|
+
section_id?: number | null,
|
|
61
|
+
approver_user_id?: number | null,
|
|
62
|
+
delegate_user_id?: number | null,
|
|
63
|
+
approved_by?: number | null,
|
|
64
|
+
service_id?: number,
|
|
65
|
+
sub_service_id?: number,
|
|
66
|
+
is_allowed?: boolean
|
|
67
|
+
) {
|
|
68
|
+
super();
|
|
69
|
+
this.request_id = request_id;
|
|
70
|
+
this.service_id = service_id || null;
|
|
71
|
+
this.sub_service_id = sub_service_id || null;
|
|
72
|
+
this.approver_role_id = approver_role_id;
|
|
73
|
+
this.comment = comment;
|
|
74
|
+
this.approval_status = approval_status;
|
|
75
|
+
this.level = level;
|
|
76
|
+
this.department_id = department_id || null;
|
|
77
|
+
this.section_id = section_id || null;
|
|
78
|
+
this.approver_user_id = approver_user_id || null;
|
|
79
|
+
this.delegate_user_id = delegate_user_id || null;
|
|
80
|
+
this.approved_by = approved_by || null;
|
|
81
|
+
this.is_allowed = is_allowed !== undefined ? is_allowed : true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'assign_tasks_emp_attachments' })
|
|
5
|
+
export class AssignTasksEmpRequestAttachment extends BaseModel {
|
|
6
|
+
|
|
7
|
+
@Column({ type: 'integer', nullable: false })
|
|
8
|
+
request_id: number;
|
|
9
|
+
|
|
10
|
+
@Column({ type: 'integer', nullable: true })
|
|
11
|
+
service_id: number | null;
|
|
12
|
+
|
|
13
|
+
@Column({ type: 'integer', nullable: true })
|
|
14
|
+
sub_service_id: number | null;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'varchar', length: 500, nullable: false })
|
|
17
|
+
file_url: string;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
20
|
+
file_name: string;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
23
|
+
file_type: string;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'bigint', nullable: true })
|
|
26
|
+
file_size: number | null;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'integer', nullable: true })
|
|
29
|
+
chat_id: number | null;
|
|
30
|
+
|
|
31
|
+
constructor(
|
|
32
|
+
request_id: number,
|
|
33
|
+
file_url: string,
|
|
34
|
+
file_name?: string,
|
|
35
|
+
file_type?: string,
|
|
36
|
+
file_size?: number,
|
|
37
|
+
service_id?: number,
|
|
38
|
+
sub_service_id?: number,
|
|
39
|
+
chat_id?: number
|
|
40
|
+
) {
|
|
41
|
+
super();
|
|
42
|
+
this.request_id = request_id;
|
|
43
|
+
this.service_id = service_id || null;
|
|
44
|
+
this.sub_service_id = sub_service_id || null;
|
|
45
|
+
this.file_url = file_url;
|
|
46
|
+
this.file_name = file_name || '';
|
|
47
|
+
this.file_type = file_type || '';
|
|
48
|
+
this.file_size = file_size || null;
|
|
49
|
+
this.chat_id = chat_id || null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum AssignTasksEmpMessageType {
|
|
5
|
+
TEXT = "text",
|
|
6
|
+
IMAGE = "image",
|
|
7
|
+
VIDEO = "video",
|
|
8
|
+
FILE = "file",
|
|
9
|
+
LINK = "link"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Entity({ name: 'assign_tasks_emp_chats' })
|
|
13
|
+
export class AssignTasksEmpRequestChat extends BaseModel {
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'integer', nullable: false })
|
|
16
|
+
request_id: number;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'integer', nullable: true })
|
|
19
|
+
service_id: number | null;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'integer', nullable: true })
|
|
22
|
+
sub_service_id: number | null;
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'integer', nullable: false })
|
|
25
|
+
user_id: number;
|
|
26
|
+
|
|
27
|
+
@Column({ type: 'integer', nullable: true })
|
|
28
|
+
role_id: number;
|
|
29
|
+
|
|
30
|
+
@Column({ type: 'text', nullable: false })
|
|
31
|
+
message: string;
|
|
32
|
+
|
|
33
|
+
@Column({
|
|
34
|
+
type: 'enum',
|
|
35
|
+
enum: AssignTasksEmpMessageType,
|
|
36
|
+
default: AssignTasksEmpMessageType.TEXT,
|
|
37
|
+
nullable: false
|
|
38
|
+
})
|
|
39
|
+
messageType: AssignTasksEmpMessageType;
|
|
40
|
+
|
|
41
|
+
@Column({ type: 'text', nullable: true })
|
|
42
|
+
status: string | null;
|
|
43
|
+
|
|
44
|
+
constructor(
|
|
45
|
+
request_id: number,
|
|
46
|
+
user_id: number,
|
|
47
|
+
role_id: number,
|
|
48
|
+
message: string,
|
|
49
|
+
service_id?: number,
|
|
50
|
+
sub_service_id?: number,
|
|
51
|
+
messageType?: AssignTasksEmpMessageType,
|
|
52
|
+
status?: string | null
|
|
53
|
+
) {
|
|
54
|
+
super();
|
|
55
|
+
this.request_id = request_id;
|
|
56
|
+
this.service_id = service_id || null;
|
|
57
|
+
this.sub_service_id = sub_service_id || null;
|
|
58
|
+
this.user_id = user_id;
|
|
59
|
+
this.role_id = role_id;
|
|
60
|
+
this.message = message;
|
|
61
|
+
this.messageType = messageType || AssignTasksEmpMessageType.TEXT;
|
|
62
|
+
this.status = status || null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum AssignTasksEmpPriority {
|
|
5
|
+
HIGH = "High",
|
|
6
|
+
MEDIUM = "Medium",
|
|
7
|
+
LOW = "Low"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum AssignTasksEmpStatus {
|
|
11
|
+
ASSIGNED = "Assigned",
|
|
12
|
+
IN_PROGRESS = "In Progress",
|
|
13
|
+
APPROVED = "Completed"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Entity({ name: 'assign_tasks_emp_requests' })
|
|
17
|
+
export class AssignTasksEmpRequests extends BaseModel {
|
|
18
|
+
|
|
19
|
+
// Common columns from duty_mission_request table
|
|
20
|
+
@Column({ type: 'int', nullable: true })
|
|
21
|
+
req_user_department_id: number | null;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'int', nullable: true })
|
|
24
|
+
req_user_section_id: number | null;
|
|
25
|
+
|
|
26
|
+
@Column({ nullable: true })
|
|
27
|
+
service_id: number;
|
|
28
|
+
|
|
29
|
+
@Column({ nullable: true })
|
|
30
|
+
sub_service_id: number;
|
|
31
|
+
|
|
32
|
+
@Column({ nullable: false })
|
|
33
|
+
user_id: number;
|
|
34
|
+
|
|
35
|
+
// New columns
|
|
36
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
37
|
+
task_title: string;
|
|
38
|
+
|
|
39
|
+
@Column({ type: 'text', nullable: false })
|
|
40
|
+
task_description: string;
|
|
41
|
+
|
|
42
|
+
@Column({
|
|
43
|
+
type: "enum",
|
|
44
|
+
enum: AssignTasksEmpPriority,
|
|
45
|
+
nullable: false,
|
|
46
|
+
})
|
|
47
|
+
priority: AssignTasksEmpPriority;
|
|
48
|
+
|
|
49
|
+
@Column({ type: "date", nullable: true })
|
|
50
|
+
completion_date: Date | null;
|
|
51
|
+
|
|
52
|
+
@Column({
|
|
53
|
+
type: "enum",
|
|
54
|
+
enum: AssignTasksEmpStatus,
|
|
55
|
+
default: AssignTasksEmpStatus.ASSIGNED,
|
|
56
|
+
nullable: false,
|
|
57
|
+
})
|
|
58
|
+
status: AssignTasksEmpStatus;
|
|
59
|
+
|
|
60
|
+
@Column({ type: "varchar", nullable: true })
|
|
61
|
+
workflow_execution_id: string | null;
|
|
62
|
+
|
|
63
|
+
constructor(
|
|
64
|
+
req_user_department_id: number | null,
|
|
65
|
+
req_user_section_id: number | null,
|
|
66
|
+
service_id: number,
|
|
67
|
+
sub_service_id: number,
|
|
68
|
+
user_id: number,
|
|
69
|
+
task_title: string,
|
|
70
|
+
task_description: string,
|
|
71
|
+
priority: AssignTasksEmpPriority,
|
|
72
|
+
status: AssignTasksEmpStatus,
|
|
73
|
+
completion_date?: Date | null,
|
|
74
|
+
workflow_execution_id?: string | null,
|
|
75
|
+
) {
|
|
76
|
+
super();
|
|
77
|
+
this.req_user_department_id = req_user_department_id ?? null;
|
|
78
|
+
this.req_user_section_id = req_user_section_id ?? null;
|
|
79
|
+
this.service_id = service_id;
|
|
80
|
+
this.sub_service_id = sub_service_id;
|
|
81
|
+
this.user_id = user_id;
|
|
82
|
+
this.task_title = task_title;
|
|
83
|
+
this.task_description = task_description;
|
|
84
|
+
this.priority = priority;
|
|
85
|
+
this.completion_date = completion_date ?? null;
|
|
86
|
+
this.status = status;
|
|
87
|
+
this.workflow_execution_id = workflow_execution_id ?? null;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum AssignTasksEmpWorkFlowStatus {
|
|
5
|
+
COMPLETED = "Completed",
|
|
6
|
+
NOT_YET_STARTED = "Not Yet Started",
|
|
7
|
+
PENDING = "Pending"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//This model is used to store the assign tasks workflow status and activity logs
|
|
11
|
+
@Entity({ name: 'assign_tasks_emp_workflows' })
|
|
12
|
+
export class AssignTasksEmpWorkFlow extends BaseModel {
|
|
13
|
+
@Column({ type: 'integer', nullable: false })
|
|
14
|
+
request_id: number;
|
|
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: 'varchar', length: 500, nullable: false })
|
|
23
|
+
content: string;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'enum', enum: AssignTasksEmpWorkFlowStatus, default: AssignTasksEmpWorkFlowStatus.NOT_YET_STARTED, nullable: false })
|
|
26
|
+
status: AssignTasksEmpWorkFlowStatus;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'integer', nullable: true })
|
|
29
|
+
user_id: number | null;
|
|
30
|
+
|
|
31
|
+
@Column({ type: 'integer', nullable: true })
|
|
32
|
+
role_id: number | null;
|
|
33
|
+
|
|
34
|
+
@Column({ type: 'integer', nullable: true })
|
|
35
|
+
department_id: number | null;
|
|
36
|
+
|
|
37
|
+
@Column({ type: 'integer', nullable: true })
|
|
38
|
+
section_id: number | null;
|
|
39
|
+
|
|
40
|
+
constructor(
|
|
41
|
+
request_id: number,
|
|
42
|
+
content: string,
|
|
43
|
+
status: AssignTasksEmpWorkFlowStatus,
|
|
44
|
+
service_id?: number,
|
|
45
|
+
sub_service_id?: number,
|
|
46
|
+
user_id?: number,
|
|
47
|
+
role_id?: number,
|
|
48
|
+
department_id?: number,
|
|
49
|
+
section_id?: number
|
|
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.content = content;
|
|
56
|
+
this.status = status;
|
|
57
|
+
this.user_id = user_id || null;
|
|
58
|
+
this.role_id = role_id || null;
|
|
59
|
+
this.department_id = department_id || null;
|
|
60
|
+
this.section_id = section_id || null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|