@platform-modules/foreign-ministry 1.1.56 → 1.1.58
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 +34 -18
- package/dist/index.d.ts +24 -9
- package/dist/index.js +24 -9
- package/dist/models/AttendanceModel.d.ts +2 -1
- package/dist/models/AttendanceModel.js +2 -1
- package/dist/models/CurrencyModel.d.ts +10 -0
- package/dist/models/CurrencyModel.js +53 -0
- package/dist/models/EarlyCheckoutApprovalModel.d.ts +1 -0
- package/dist/models/EarlyCheckoutApprovalModel.js +4 -0
- package/dist/models/EarlyCheckoutChatModel.d.ts +4 -0
- package/dist/models/EarlyCheckoutChatModel.js +28 -2
- package/dist/models/EarlyCheckoutWorkflowModel.d.ts +4 -0
- package/dist/models/EarlyCheckoutWorkflowModel.js +16 -0
- package/dist/models/FinancialApprovalsModel.d.ts +2 -1
- package/dist/models/FinancialApprovalsModel.js +7 -2
- package/dist/models/FinancialChatsModel.d.ts +16 -1
- package/dist/models/FinancialChatsModel.js +33 -3
- package/dist/models/FinancialRequestsModel.d.ts +1 -1
- package/dist/models/FinancialRequestsModel.js +3 -3
- package/dist/models/FinancialWorkFlowModel.d.ts +3 -1
- package/dist/models/FinancialWorkFlowModel.js +11 -2
- package/dist/models/GeneralServiceApprovalsModel.d.ts +26 -0
- package/dist/models/GeneralServiceApprovalsModel.js +109 -0
- package/dist/models/GeneralServiceAttachmentsModel.d.ts +10 -0
- package/dist/models/{DiplomaticAttachmentsModel.js → GeneralServiceAttachmentsModel.js} +18 -22
- package/dist/models/GeneralServiceChatsModel.d.ts +9 -0
- package/dist/models/{DiplomaticChatsModel.js → GeneralServiceChatsModel.js} +17 -21
- package/dist/models/GeneralServiceRequestsModel.d.ts +36 -0
- package/dist/models/GeneralServiceRequestsModel.js +137 -0
- package/dist/models/GeneralServiceWorkFlowModel.d.ts +21 -0
- package/dist/models/GeneralServiceWorkFlowModel.js +80 -0
- package/dist/models/GroupModel.d.ts +16 -0
- package/dist/models/GroupModel.js +44 -0
- package/dist/models/GroupNamesModel.d.ts +6 -0
- package/dist/models/GroupNamesModel.js +34 -0
- package/dist/models/HelpdeskCategoriesModel.d.ts +9 -0
- package/dist/models/{DiplomaticClubCardAttachmentModel.js → HelpdeskCategoriesModel.js} +27 -22
- package/dist/models/HelpdeskSubCategoriesModel.d.ts +10 -0
- package/dist/models/{PassportRequestAttachmentModel.js → HelpdeskSubCategoriesModel.js} +29 -29
- package/dist/models/IssueTypesModel.d.ts +10 -0
- package/dist/models/IssueTypesModel.js +54 -0
- package/dist/models/JobsModel.d.ts +17 -0
- package/dist/models/{DiplomaticClubCardChatModel.js → JobsModel.js} +29 -16
- package/dist/models/LeaveApprovalsModel.d.ts +4 -1
- package/dist/models/LeaveApprovalsModel.js +9 -0
- package/dist/models/LeaveAttachmentsModel.d.ts +6 -2
- package/dist/models/LeaveAttachmentsModel.js +27 -7
- package/dist/models/LeaveChatModel.d.ts +5 -1
- package/dist/models/LeaveChatModel.js +22 -2
- package/dist/models/LeaveRequestModel.d.ts +12 -1
- package/dist/models/LeaveRequestModel.js +35 -0
- package/dist/models/LeaveWorkFlowModel.d.ts +5 -1
- package/dist/models/LeaveWorkFlowModel.js +22 -2
- package/dist/models/MounringLeaveRelationModel.d.ts +2 -1
- package/dist/models/MounringLeaveRelationModel.js +7 -2
- package/dist/models/ReimbursementRequestsModel.d.ts +2 -1
- package/dist/models/ReimbursementRequestsModel.js +9 -4
- package/dist/models/RoutingGroupsModel.d.ts +14 -0
- package/dist/models/RoutingGroupsModel.js +71 -0
- package/dist/models/StayAfterHoursApprovalModel.d.ts +1 -0
- package/dist/models/StayAfterHoursApprovalModel.js +4 -0
- package/dist/models/StayAfterHoursChatModel.d.ts +4 -0
- package/dist/models/StayAfterHoursChatModel.js +28 -2
- package/dist/models/StayAfterHoursWorkflowModel.d.ts +4 -0
- package/dist/models/StayAfterHoursWorkflowModel.js +16 -0
- package/dist/models/TelephoneDirectoryModel.d.ts +21 -0
- package/dist/models/TelephoneDirectoryModel.js +108 -0
- package/dist/models/TransferMissionApprovalModel.d.ts +21 -0
- package/dist/models/TransferMissionApprovalModel.js +75 -0
- package/dist/models/TransferMissionAttachmentModel.d.ts +11 -0
- package/dist/models/TransferMissionAttachmentModel.js +52 -0
- package/dist/models/TransferMissionChatModel.d.ts +19 -0
- package/dist/models/TransferMissionChatModel.js +78 -0
- package/dist/models/TransferMissionRequestModel.d.ts +36 -0
- package/dist/models/TransferMissionRequestModel.js +132 -0
- package/dist/models/TransferMissionWorkflowModel.d.ts +17 -0
- package/dist/models/TransferMissionWorkflowModel.js +62 -0
- package/dist/models/UpdateAttendanceApprovalModel.d.ts +21 -0
- package/dist/models/UpdateAttendanceApprovalModel.js +75 -0
- package/dist/models/UpdateAttendanceChatModel.d.ts +16 -0
- package/dist/models/UpdateAttendanceChatModel.js +52 -0
- package/dist/models/UpdateAttendanceRequestModel.d.ts +28 -0
- package/dist/models/UpdateAttendanceRequestModel.js +86 -0
- package/dist/models/UpdateAttendanceWorkflowModel.d.ts +13 -0
- package/dist/models/UpdateAttendanceWorkflowModel.js +46 -0
- package/dist/models/WorkScheduleModel.d.ts +19 -0
- package/dist/models/WorkScheduleModel.js +60 -0
- package/dist/models/WorkflowTask.d.ts +5 -2
- package/dist/models/WorkflowTask.js +28 -4
- package/dist/models/WorkflowTaskNames.d.ts +12 -3
- package/dist/models/WorkflowTaskNames.js +28 -9
- package/package.json +1 -1
- package/src/data-source.ts +45 -30
- package/src/index.ts +24 -9
- package/src/models/AttendanceModel.ts +2 -1
- package/src/models/CurrencyModel.ts +38 -0
- package/src/models/EarlyCheckoutApprovalModel.ts +3 -0
- package/src/models/EarlyCheckoutChatModel.ts +34 -1
- package/src/models/EarlyCheckoutWorkflowModel.ts +12 -0
- package/src/models/FinancialApprovalsModel.ts +6 -1
- package/src/models/FinancialChatsModel.ts +27 -1
- package/src/models/FinancialRequestsModel.ts +2 -2
- package/src/models/FinancialWorkFlowModel.ts +9 -1
- package/src/models/GeneralServiceApprovalsModel.ts +95 -0
- package/src/models/GeneralServiceAttachmentsModel.ts +43 -0
- package/src/models/GeneralServiceChatsModel.ts +39 -0
- package/src/models/GeneralServiceRequestsModel.ts +113 -0
- package/src/models/GeneralServiceWorkFlowModel.ts +78 -0
- package/src/models/GroupModel.ts +30 -0
- package/src/models/GroupNamesModel.ts +22 -0
- package/src/models/HelpdeskCategoriesModel.ts +35 -0
- package/src/models/HelpdeskSubCategoriesModel.ts +40 -0
- package/src/models/IssueTypesModel.ts +47 -0
- package/src/models/JobsModel.ts +37 -0
- package/src/models/LeaveApprovalsModel.ts +8 -1
- package/src/models/LeaveAttachmentsModel.ts +21 -5
- package/src/models/LeaveChatModel.ts +17 -1
- package/src/models/LeaveRequestModel.ts +29 -1
- package/src/models/LeaveWorkFlowModel.ts +17 -1
- package/src/models/MounringLeaveRelationModel.ts +5 -1
- package/src/models/ReimbursementRequestsModel.ts +8 -6
- package/src/models/RoutingGroupsModel.ts +67 -0
- package/src/models/StayAfterHoursApprovalModel.ts +3 -0
- package/src/models/StayAfterHoursChatModel.ts +34 -1
- package/src/models/StayAfterHoursWorkflowModel.ts +12 -0
- package/src/models/TelephoneDirectoryModel.ts +84 -0
- package/src/models/TransferMissionApprovalModel.ts +49 -0
- package/src/models/TransferMissionAttachmentModel.ts +31 -0
- package/src/models/TransferMissionChatModel.ts +66 -0
- package/src/models/TransferMissionRequestModel.ts +94 -0
- package/src/models/TransferMissionWorkflowModel.ts +39 -0
- package/src/models/UpdateAttendanceApprovalModel.ts +50 -0
- package/src/models/UpdateAttendanceChatModel.ts +35 -0
- package/src/models/UpdateAttendanceRequestModel.ts +63 -0
- package/src/models/UpdateAttendanceWorkflowModel.ts +28 -0
- package/src/models/WorkScheduleModel.ts +47 -0
- package/src/models/WorkflowTask.ts +31 -4
- package/src/models/WorkflowTaskNames.ts +27 -8
- package/dist/models/DiplomaticApprovalsModel.d.ts +0 -25
- package/dist/models/DiplomaticApprovalsModel.js +0 -95
- package/dist/models/DiplomaticAttachmentsModel.d.ts +0 -12
- package/dist/models/DiplomaticChatsModel.d.ts +0 -11
- package/dist/models/DiplomaticClubCardApprovalModel.d.ts +0 -16
- package/dist/models/DiplomaticClubCardApprovalModel.js +0 -58
- package/dist/models/DiplomaticClubCardAttachmentModel.d.ts +0 -9
- package/dist/models/DiplomaticClubCardChatModel.d.ts +0 -7
- package/dist/models/DiplomaticClubCardMemberModel.d.ts +0 -13
- package/dist/models/DiplomaticClubCardMemberModel.js +0 -60
- package/dist/models/DiplomaticClubCardRequestModel.d.ts +0 -33
- package/dist/models/DiplomaticClubCardRequestModel.js +0 -98
- package/dist/models/DiplomaticClubCardWorkFlowModel.d.ts +0 -12
- package/dist/models/DiplomaticClubCardWorkFlowModel.js +0 -42
- package/dist/models/DiplomaticRequestsModel.d.ts +0 -43
- package/dist/models/DiplomaticRequestsModel.js +0 -142
- package/dist/models/DiplomaticServiceDetailsModel.d.ts +0 -20
- package/dist/models/DiplomaticServiceDetailsModel.js +0 -65
- package/dist/models/DiplomaticSettingsModel.d.ts +0 -11
- package/dist/models/DiplomaticSettingsModel.js +0 -59
- package/dist/models/DiplomaticTitleModel.d.ts +0 -12
- package/dist/models/DiplomaticTitleModel.js +0 -45
- package/dist/models/DiplomaticWorkFlowModel.d.ts +0 -21
- package/dist/models/DiplomaticWorkFlowModel.js +0 -78
- package/dist/models/PassportRequestApprovalModel.d.ts +0 -22
- package/dist/models/PassportRequestApprovalModel.js +0 -91
- package/dist/models/PassportRequestAttachmentModel.d.ts +0 -10
- package/dist/models/PassportRequestChatModel.d.ts +0 -8
- package/dist/models/PassportRequestChatModel.js +0 -44
- package/dist/models/PassportRequestDependentModel.d.ts +0 -20
- package/dist/models/PassportRequestDependentModel.js +0 -85
- package/dist/models/PassportRequestModel.d.ts +0 -40
- package/dist/models/PassportRequestModel.js +0 -128
- package/dist/models/PassportRequestWorkFlowModel.d.ts +0 -15
- package/dist/models/PassportRequestWorkFlowModel.js +0 -60
- package/dist/models/SubscriptionAmountModel.d.ts +0 -67
- package/dist/models/SubscriptionAmountModel.js +0 -114
- package/src/models/DiplomaticApprovalsModel.ts +0 -78
- package/src/models/DiplomaticAttachmentsModel.ts +0 -45
- package/src/models/DiplomaticChatsModel.ts +0 -41
- package/src/models/DiplomaticRequestsModel.ts +0 -121
- package/src/models/DiplomaticServiceDetailsModel.ts +0 -51
- package/src/models/DiplomaticSettingsModel.ts +0 -45
- package/src/models/DiplomaticTitleModel.ts +0 -27
- package/src/models/DiplomaticWorkFlowModel.ts +0 -62
- package/src/models/SubscriptionAmountModel.ts +0 -95
|
@@ -30,6 +30,12 @@ export class FinancialWorkFlow extends BaseModel {
|
|
|
30
30
|
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
31
31
|
activity_date: Date;
|
|
32
32
|
|
|
33
|
+
@Column({ type: 'int', nullable: true })
|
|
34
|
+
approved_by_role_id: number;
|
|
35
|
+
|
|
36
|
+
@Column({ type: 'int', nullable: true })
|
|
37
|
+
step_order: number;
|
|
38
|
+
|
|
33
39
|
@ManyToOne(() => FinancialRequests, fr => fr.workflows)
|
|
34
40
|
@JoinColumn({ name: 'financial_request_id' })
|
|
35
41
|
financialRequest?: FinancialRequests;
|
|
@@ -38,7 +44,8 @@ export class FinancialWorkFlow extends BaseModel {
|
|
|
38
44
|
financial_request_id: number,
|
|
39
45
|
status: FinancialWorkFlowStatus,
|
|
40
46
|
approved_by_user_id: number,
|
|
41
|
-
content: string
|
|
47
|
+
content: string,
|
|
48
|
+
step_order:number
|
|
42
49
|
) {
|
|
43
50
|
super();
|
|
44
51
|
this.financial_request_id = financial_request_id;
|
|
@@ -47,6 +54,7 @@ export class FinancialWorkFlow extends BaseModel {
|
|
|
47
54
|
this.content = content;
|
|
48
55
|
this.financial_approval_id = 0;
|
|
49
56
|
this.activity_date = new Date();
|
|
57
|
+
this.step_order = step_order
|
|
50
58
|
}
|
|
51
59
|
}
|
|
52
60
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum GeneralServiceApprovalStatus {
|
|
5
|
+
PENDING = "Pending",
|
|
6
|
+
APPROVED = "Approved",
|
|
7
|
+
REJECTED = "Rejected",
|
|
8
|
+
SKIPPED = "Skipped",
|
|
9
|
+
IN_PROGRESS = "In Progress"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Entity({ name: 'general_service_approvals' })
|
|
13
|
+
export class GeneralServiceApprovals extends BaseModel {
|
|
14
|
+
@Column({ type: 'int' })
|
|
15
|
+
request_id: number;
|
|
16
|
+
|
|
17
|
+
@Column({ type: 'int' })
|
|
18
|
+
level: number;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'int', nullable: true })
|
|
21
|
+
approver_user_id: number | null;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'int' })
|
|
24
|
+
approver_role_id: number;
|
|
25
|
+
|
|
26
|
+
@Column({ type: 'text', nullable: true })
|
|
27
|
+
comment: string | null;
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'enum', enum: GeneralServiceApprovalStatus, default: GeneralServiceApprovalStatus.PENDING })
|
|
30
|
+
approval_status: GeneralServiceApprovalStatus;
|
|
31
|
+
|
|
32
|
+
@Column({ type: 'timestamp', nullable: true })
|
|
33
|
+
action_date: Date;
|
|
34
|
+
|
|
35
|
+
@Column({ type: 'int', nullable: true })
|
|
36
|
+
department_id: number | null;
|
|
37
|
+
|
|
38
|
+
@Column({ type: 'int', nullable: true })
|
|
39
|
+
section_id: number | null;
|
|
40
|
+
|
|
41
|
+
@Column({ type: 'int', nullable: true })
|
|
42
|
+
approved_by: number | null;
|
|
43
|
+
|
|
44
|
+
@Column({ type: 'int', nullable: true })
|
|
45
|
+
service_id: number | null; // For filtering and multi-service support
|
|
46
|
+
|
|
47
|
+
@Column({ type: 'int', nullable: true })
|
|
48
|
+
sub_service_id: number | null; // For filtering and multi-service support
|
|
49
|
+
|
|
50
|
+
// Helpdesk-specific fields (for assignment/routing tracking)
|
|
51
|
+
@Column({ type: 'int', nullable: true })
|
|
52
|
+
assigned_group_id: number | null; // Assigned group ID (for helpdesk routing)
|
|
53
|
+
|
|
54
|
+
@Column({ type: 'int', nullable: true })
|
|
55
|
+
transfer_from_user_id: number | null; // User who transferred from
|
|
56
|
+
|
|
57
|
+
@Column({ type: 'int', nullable: true })
|
|
58
|
+
transfer_to_user_id: number | null; // User who transferred to
|
|
59
|
+
|
|
60
|
+
// @Column({ type: 'timestamp', nullable: true })
|
|
61
|
+
// sla_start_time: Date | null; // SLA tracking start time for this assignment
|
|
62
|
+
|
|
63
|
+
// @Column({ type: 'timestamp', nullable: true })
|
|
64
|
+
// sla_end_time: Date | null; // SLA tracking end time for this assignment
|
|
65
|
+
|
|
66
|
+
// @Column({ type: 'boolean', default: false })
|
|
67
|
+
// sla_breached: boolean; // Whether SLA was breached for this assignment
|
|
68
|
+
|
|
69
|
+
// Note: No relationship mapping - this table is generic and can be used with any request table
|
|
70
|
+
// Use request_id to join manually when needed
|
|
71
|
+
|
|
72
|
+
constructor(
|
|
73
|
+
request_id: number,
|
|
74
|
+
level: number,
|
|
75
|
+
approver_role_id: number,
|
|
76
|
+
approval_status: GeneralServiceApprovalStatus,
|
|
77
|
+
department_id: number | null,
|
|
78
|
+
section_id: number | null,
|
|
79
|
+
approved_by: number | null,
|
|
80
|
+
service_id?: number | null,
|
|
81
|
+
sub_service_id?: number | null
|
|
82
|
+
) {
|
|
83
|
+
super();
|
|
84
|
+
this.request_id = request_id;
|
|
85
|
+
this.level = level;
|
|
86
|
+
this.approver_role_id = approver_role_id;
|
|
87
|
+
this.approval_status = approval_status;
|
|
88
|
+
this.department_id = department_id;
|
|
89
|
+
this.section_id = section_id;
|
|
90
|
+
this.approved_by = approved_by;
|
|
91
|
+
this.service_id = service_id || null;
|
|
92
|
+
this.sub_service_id = sub_service_id || null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'general_service_attachments' })
|
|
5
|
+
export class GeneralServiceAttachments extends BaseModel {
|
|
6
|
+
@Column({ type: 'int' })
|
|
7
|
+
request_id: number;
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'varchar', length: 500 })
|
|
10
|
+
file_url: string;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'varchar', length: 255 })
|
|
13
|
+
file_name: string;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'varchar', length: 50, nullable: true })
|
|
16
|
+
file_type: string; // PDF, JPG, PNG, etc.
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'int', nullable: true })
|
|
19
|
+
service_id: number | null; // For filtering and multi-service support
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'int', nullable: true })
|
|
22
|
+
sub_service_id: number | null; // For filtering and multi-service support
|
|
23
|
+
|
|
24
|
+
// Note: No relationship mapping - this table is generic and can be used with any request table
|
|
25
|
+
// Use request_id to join manually when needed
|
|
26
|
+
|
|
27
|
+
constructor(
|
|
28
|
+
request_id: number,
|
|
29
|
+
file_url: string,
|
|
30
|
+
file_name: string,
|
|
31
|
+
service_id?: number | null,
|
|
32
|
+
sub_service_id?: number | null
|
|
33
|
+
) {
|
|
34
|
+
super();
|
|
35
|
+
this.request_id = request_id;
|
|
36
|
+
this.file_url = file_url;
|
|
37
|
+
this.file_name = file_name;
|
|
38
|
+
this.file_type = 'PDF';
|
|
39
|
+
this.service_id = service_id || null;
|
|
40
|
+
this.sub_service_id = sub_service_id || null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'general_service_chats' })
|
|
5
|
+
export class GeneralServiceChats extends BaseModel {
|
|
6
|
+
@Column({ type: 'int' })
|
|
7
|
+
request_id: number;
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'text' })
|
|
10
|
+
content: string;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'int' })
|
|
13
|
+
sender_user_id: number;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'int', nullable: true })
|
|
16
|
+
service_id: number | null; // For filtering and multi-service support
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'int', nullable: true })
|
|
19
|
+
sub_service_id: number | null; // For filtering and multi-service support
|
|
20
|
+
|
|
21
|
+
// Note: No relationship mapping - this table is generic and can be used with any request table
|
|
22
|
+
// Use request_id to join manually when needed
|
|
23
|
+
|
|
24
|
+
constructor(
|
|
25
|
+
request_id: number,
|
|
26
|
+
content: string,
|
|
27
|
+
sender_user_id: number,
|
|
28
|
+
service_id?: number | null,
|
|
29
|
+
sub_service_id?: number | null
|
|
30
|
+
) {
|
|
31
|
+
super();
|
|
32
|
+
this.request_id = request_id;
|
|
33
|
+
this.content = content;
|
|
34
|
+
this.sender_user_id = sender_user_id;
|
|
35
|
+
this.service_id = service_id || null;
|
|
36
|
+
this.sub_service_id = sub_service_id || null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum GeneralServiceRequestStatus {
|
|
5
|
+
DRAFT = "Draft",
|
|
6
|
+
SUBMITTED = "Submitted",
|
|
7
|
+
PENDING = "Pending",
|
|
8
|
+
IN_PROGRESS = "In Progress",
|
|
9
|
+
APPROVED = "Approved",
|
|
10
|
+
REJECTED = "Rejected",
|
|
11
|
+
COMPLETED = "Completed",
|
|
12
|
+
CANCELLED = "Cancelled"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Entity({ name: 'general_service_requests' })
|
|
16
|
+
export class GeneralServiceRequests extends BaseModel {
|
|
17
|
+
@Column({ type: 'int' })
|
|
18
|
+
user_id: number;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'varchar', length: 20, nullable: true })
|
|
21
|
+
contact_number: string | null;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
24
|
+
person_name: string | null;
|
|
25
|
+
|
|
26
|
+
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
27
|
+
request_date: Date;
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'enum', enum: GeneralServiceRequestStatus, default: GeneralServiceRequestStatus.PENDING })
|
|
30
|
+
request_status: GeneralServiceRequestStatus;
|
|
31
|
+
|
|
32
|
+
@Column({ type: 'timestamp', nullable: true })
|
|
33
|
+
request_close_date: Date | null;
|
|
34
|
+
|
|
35
|
+
@Column({ type: 'text', nullable: true })
|
|
36
|
+
problem: string | null;
|
|
37
|
+
|
|
38
|
+
@Column({ type: 'int', nullable: true })
|
|
39
|
+
service_id: number | null;
|
|
40
|
+
|
|
41
|
+
@Column({ type: 'int', nullable: true })
|
|
42
|
+
sub_service_id: number | null;
|
|
43
|
+
|
|
44
|
+
@Column({ type: 'int', nullable: true })
|
|
45
|
+
section_id: number | null;
|
|
46
|
+
|
|
47
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
48
|
+
workflow_execution_id: string | null;
|
|
49
|
+
|
|
50
|
+
@Column({ type: 'int', nullable: true })
|
|
51
|
+
issue_type_id: number | null; // Reference to issue types table
|
|
52
|
+
|
|
53
|
+
@Column({ type: 'int', nullable: true })
|
|
54
|
+
assigned_group_id: number | null; // Reference to routing groups table
|
|
55
|
+
|
|
56
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
57
|
+
group_name: string | null; // Auto-populated routing group name
|
|
58
|
+
|
|
59
|
+
// Helpdesk-specific fields
|
|
60
|
+
@Column({ type: 'int', nullable: true })
|
|
61
|
+
category_id: number | null; // Helpdesk category (IT, Non-IT, etc.)
|
|
62
|
+
|
|
63
|
+
@Column({ type: 'int', nullable: true })
|
|
64
|
+
subcategory_id: number | null; // Helpdesk subcategory
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@Column({ type: 'int', nullable: true })
|
|
68
|
+
current_assignee_group_id: number | null; // Currently assigned group
|
|
69
|
+
|
|
70
|
+
@Column({ type: 'int', nullable: true })
|
|
71
|
+
current_assignee_user_id: number | null; // Currently assigned individual user (for individual routing)
|
|
72
|
+
|
|
73
|
+
@Column({ type: 'text', nullable: true })
|
|
74
|
+
closure_reason: string | null; // Reason for closure (requirement #12)
|
|
75
|
+
|
|
76
|
+
@Column({ type: 'text', nullable: true })
|
|
77
|
+
description: string | null;
|
|
78
|
+
|
|
79
|
+
@Column({ type: 'text', nullable: true })
|
|
80
|
+
extension_number: string | null;
|
|
81
|
+
|
|
82
|
+
@Column({ type: 'text', nullable: true })
|
|
83
|
+
priority: string | null;
|
|
84
|
+
|
|
85
|
+
// @Column({ type: 'timestamp', nullable: true })
|
|
86
|
+
// sla_start_time: Date | null; // SLA tracking start time
|
|
87
|
+
|
|
88
|
+
// @Column({ type: 'timestamp', nullable: true })
|
|
89
|
+
// sla_end_time: Date | null; // SLA tracking end time
|
|
90
|
+
|
|
91
|
+
// @Column({ type: 'boolean', default: false })
|
|
92
|
+
// sla_breached: boolean; // Whether SLA was breached
|
|
93
|
+
|
|
94
|
+
// Note: No relationship mappings - these 4 tables (approvals, workflows, chats, attachments)
|
|
95
|
+
// are generic and can be used with any request table. Use request_id to join manually when needed.
|
|
96
|
+
|
|
97
|
+
constructor(
|
|
98
|
+
user_id: number,
|
|
99
|
+
service_id: number | null,
|
|
100
|
+
sub_service_id: number | null,
|
|
101
|
+
section_id: number | null,
|
|
102
|
+
) {
|
|
103
|
+
super();
|
|
104
|
+
this.user_id = user_id;
|
|
105
|
+
|
|
106
|
+
this.request_date = new Date();
|
|
107
|
+
this.request_status = GeneralServiceRequestStatus.PENDING;
|
|
108
|
+
this.service_id = service_id;
|
|
109
|
+
this.sub_service_id = sub_service_id;
|
|
110
|
+
this.section_id = section_id;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum GeneralServiceWorkFlowStatus {
|
|
5
|
+
COMPLETED = "Completed",
|
|
6
|
+
NOT_YET_STARTED = "Not Yet Started",
|
|
7
|
+
PENDING = "Pending",
|
|
8
|
+
IN_PROGRESS = "In Progress",
|
|
9
|
+
FAILED = "Failed"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Entity({ name: 'general_service_work_flows' })
|
|
13
|
+
export class GeneralServiceWorkFlow extends BaseModel {
|
|
14
|
+
@Column({ type: 'int' })
|
|
15
|
+
request_id: number;
|
|
16
|
+
|
|
17
|
+
@Column({ type: 'int', nullable: true, default: 0 })
|
|
18
|
+
approval_id: number;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'enum', enum: GeneralServiceWorkFlowStatus, default: GeneralServiceWorkFlowStatus.NOT_YET_STARTED })
|
|
21
|
+
status: GeneralServiceWorkFlowStatus;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'int', nullable: true })
|
|
24
|
+
approved_by_user_id: number;
|
|
25
|
+
|
|
26
|
+
@Column({ type: 'int', nullable: true })
|
|
27
|
+
approved_by_role_id: number;
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'varchar', length: 500 })
|
|
30
|
+
content: string;
|
|
31
|
+
|
|
32
|
+
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
33
|
+
date: Date;
|
|
34
|
+
|
|
35
|
+
@Column({ type: 'int', nullable: true })
|
|
36
|
+
service_id: number | null; // For filtering and multi-service support
|
|
37
|
+
|
|
38
|
+
@Column({ type: 'int', nullable: true })
|
|
39
|
+
sub_service_id: number | null; // For filtering and multi-service support
|
|
40
|
+
|
|
41
|
+
// Helpdesk-specific fields (for transfer tracking and closure)
|
|
42
|
+
// @Column({ type: 'int', nullable: true })
|
|
43
|
+
// transfer_from_group_id: number | null; // Group transferred from
|
|
44
|
+
|
|
45
|
+
// @Column({ type: 'int', nullable: true })
|
|
46
|
+
// transfer_to_group_id: number | null; // Group transferred to
|
|
47
|
+
|
|
48
|
+
// @Column({ type: 'int', nullable: true })
|
|
49
|
+
// transfer_from_user_id: number | null; // User transferred from
|
|
50
|
+
|
|
51
|
+
// @Column({ type: 'int', nullable: true })
|
|
52
|
+
// transfer_to_user_id: number | null; // User transferred to
|
|
53
|
+
|
|
54
|
+
@Column({ type: 'text', nullable: true })
|
|
55
|
+
closure_reason: string | null; // Reason for closure (requirement #12)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
constructor(
|
|
59
|
+
request_id: number,
|
|
60
|
+
status: GeneralServiceWorkFlowStatus,
|
|
61
|
+
approved_by_user_id: number,
|
|
62
|
+
approved_by_role_id: number,
|
|
63
|
+
content: string,
|
|
64
|
+
service_id?: number | null,
|
|
65
|
+
sub_service_id?: number | null
|
|
66
|
+
) {
|
|
67
|
+
super();
|
|
68
|
+
this.request_id = request_id;
|
|
69
|
+
this.status = status;
|
|
70
|
+
this.approved_by_user_id = approved_by_user_id;
|
|
71
|
+
this.approved_by_role_id = approved_by_role_id;
|
|
72
|
+
this.content = content;
|
|
73
|
+
this.date = new Date();
|
|
74
|
+
this.service_id = service_id || null;
|
|
75
|
+
this.sub_service_id = sub_service_id || null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** *
|
|
2
|
+
@author
|
|
3
|
+
Amnet Digital
|
|
4
|
+
@date
|
|
5
|
+
2024-05-20
|
|
6
|
+
@Model
|
|
7
|
+
Group
|
|
8
|
+
@usage
|
|
9
|
+
Group Information will store
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { Column, Entity } from "typeorm";
|
|
13
|
+
import { BaseModel } from './BaseModel';
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@Entity({ name: 'Groups' })
|
|
17
|
+
export class Group extends BaseModel {
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'bigint', nullable: false })
|
|
20
|
+
group_id: number;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'bigint', nullable: false })
|
|
23
|
+
user_id: number;
|
|
24
|
+
|
|
25
|
+
constructor(group_id: number, user_id: number) {
|
|
26
|
+
super();
|
|
27
|
+
this.group_id = group_id
|
|
28
|
+
this.user_id = user_id
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
import { Column, Entity } from "typeorm";
|
|
3
|
+
import { BaseModel } from './BaseModel';
|
|
4
|
+
|
|
5
|
+
@Entity({ name: 'group_names' })
|
|
6
|
+
export class GroupNames extends BaseModel {
|
|
7
|
+
|
|
8
|
+
@Column({ nullable: false })
|
|
9
|
+
name: string;
|
|
10
|
+
|
|
11
|
+
@Column({ nullable: true })
|
|
12
|
+
description: string;
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
name: string,
|
|
16
|
+
description: string
|
|
17
|
+
) {
|
|
18
|
+
super();
|
|
19
|
+
this.name = name;
|
|
20
|
+
this.description = description;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'helpdesk_categories' })
|
|
5
|
+
export class HelpdeskCategories extends BaseModel {
|
|
6
|
+
@Column({ type: 'varchar', length: 255 })
|
|
7
|
+
name: string; // e.g., "IT", "Non-IT", "HR", "Finance"
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'varchar', length: 500, nullable: true })
|
|
10
|
+
description: string | null;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'varchar', length: 50, nullable: true })
|
|
13
|
+
code: string | null; // e.g., "IT", "NON_IT"
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'boolean', default: true })
|
|
16
|
+
is_active: boolean;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'int', nullable: true })
|
|
19
|
+
priority: number | null; // For ordering
|
|
20
|
+
|
|
21
|
+
constructor(
|
|
22
|
+
name: string,
|
|
23
|
+
description?: string | null,
|
|
24
|
+
code?: string | null,
|
|
25
|
+
priority?: number | null
|
|
26
|
+
) {
|
|
27
|
+
super();
|
|
28
|
+
this.name = name;
|
|
29
|
+
this.description = description || null;
|
|
30
|
+
this.code = code || null;
|
|
31
|
+
this.is_active = true;
|
|
32
|
+
this.priority = priority || null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'helpdesk_sub_categories' })
|
|
5
|
+
export class HelpdeskSubCategories extends BaseModel {
|
|
6
|
+
@Column({ type: 'varchar', length: 255 })
|
|
7
|
+
name: string; // e.g., "Hardware", "Software", "Network", "Payroll", "Leave"
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'varchar', length: 500, nullable: true })
|
|
10
|
+
description: string | null;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'int' })
|
|
13
|
+
category_id: number; // Reference to helpdesk_categories (use join in queries)
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'varchar', length: 50, nullable: true })
|
|
16
|
+
code: string | null; // e.g., "HW", "SW", "NET"
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'boolean', default: true })
|
|
19
|
+
is_active: boolean;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'int', nullable: true })
|
|
22
|
+
priority: number | null; // For ordering
|
|
23
|
+
|
|
24
|
+
constructor(
|
|
25
|
+
name: string,
|
|
26
|
+
category_id: number,
|
|
27
|
+
description?: string | null,
|
|
28
|
+
code?: string | null,
|
|
29
|
+
priority?: number | null
|
|
30
|
+
) {
|
|
31
|
+
super();
|
|
32
|
+
this.name = name;
|
|
33
|
+
this.category_id = category_id;
|
|
34
|
+
this.description = description || null;
|
|
35
|
+
this.code = code || null;
|
|
36
|
+
this.is_active = true;
|
|
37
|
+
this.priority = priority || null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'issue_types' })
|
|
5
|
+
export class IssueTypes extends BaseModel {
|
|
6
|
+
@Column({ type: 'varchar', length: 100 })
|
|
7
|
+
name: string; // e.g., "Hardware Issue", "Software Issue", "Network Problem"
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'varchar', length: 500, nullable: true })
|
|
10
|
+
description: string | null;
|
|
11
|
+
|
|
12
|
+
// For backward compatibility with other services
|
|
13
|
+
// @Column({ type: 'int', nullable: true })
|
|
14
|
+
// service_id: number | null; // Service/Category (legacy)
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'int', nullable: true })
|
|
17
|
+
category_id: number | null; // Service/Category (legacy)
|
|
18
|
+
|
|
19
|
+
// @Column({ type: 'int', nullable: true })
|
|
20
|
+
// sub_service_id: number | null; // Sub-Service/Subcategory (legacy)
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'int', nullable: true })
|
|
23
|
+
subcategory_id: number | null; // Sub-Service/Subcategory (legacy)
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'boolean', default: true })
|
|
26
|
+
is_active: boolean;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'int', nullable: true })
|
|
29
|
+
priority: number | null; // 1=High, 2=Medium, 3=Low
|
|
30
|
+
|
|
31
|
+
constructor(
|
|
32
|
+
name: string,
|
|
33
|
+
description?: string,
|
|
34
|
+
priority?: number | null,
|
|
35
|
+
category_id?: number | null,
|
|
36
|
+
subcategory_id?: number | null,
|
|
37
|
+
) {
|
|
38
|
+
super();
|
|
39
|
+
this.name = name;
|
|
40
|
+
this.category_id = category_id || null;
|
|
41
|
+
this.subcategory_id = subcategory_id || null;
|
|
42
|
+
this.description = description || null;
|
|
43
|
+
this.is_active = true;
|
|
44
|
+
this.priority = priority || null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author
|
|
3
|
+
* Amnet Digital
|
|
4
|
+
* @date
|
|
5
|
+
* 2024-12-20
|
|
6
|
+
* @Model
|
|
7
|
+
* Jobs
|
|
8
|
+
* @usage
|
|
9
|
+
* Jobs Information will store
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { Column, Entity } from "typeorm";
|
|
13
|
+
import { BaseModel } from './BaseModel';
|
|
14
|
+
|
|
15
|
+
@Entity({ name: 'jobs' })
|
|
16
|
+
export class Jobs extends BaseModel {
|
|
17
|
+
@Column({ type: 'varchar', nullable: false })
|
|
18
|
+
title: string;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'integer', nullable: false })
|
|
21
|
+
grade: number;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'text', nullable: false })
|
|
24
|
+
description: string;
|
|
25
|
+
|
|
26
|
+
constructor(
|
|
27
|
+
title: string,
|
|
28
|
+
grade: number,
|
|
29
|
+
description: string
|
|
30
|
+
) {
|
|
31
|
+
super();
|
|
32
|
+
this.title = title;
|
|
33
|
+
this.grade = grade;
|
|
34
|
+
this.description = description;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
@@ -5,7 +5,8 @@ import { BaseModel } from './BaseModel';
|
|
|
5
5
|
export enum ApprovalStatus {
|
|
6
6
|
PENDING = "Pending",
|
|
7
7
|
APPROVED = "Approved",
|
|
8
|
-
REJECTED = "Rejected"
|
|
8
|
+
REJECTED = "Rejected",
|
|
9
|
+
IN_PROGRESS = "In Progress"
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
//This model is used to store the store the leave apporval details of the user for the leave request
|
|
@@ -23,6 +24,12 @@ export class LeaveApprovalDetails extends BaseModel {
|
|
|
23
24
|
@Column({ type: 'int', nullable: true })
|
|
24
25
|
approver_role_id: number;
|
|
25
26
|
|
|
27
|
+
@Column({ type: 'integer', nullable: true })
|
|
28
|
+
delegate_user_id: number | null;
|
|
29
|
+
|
|
30
|
+
@Column({ type: 'integer', nullable: true })
|
|
31
|
+
approved_by: number | null;
|
|
32
|
+
|
|
26
33
|
@Column({ type: 'int', nullable: true })
|
|
27
34
|
department_id: number;
|
|
28
35
|
|
|
@@ -5,17 +5,33 @@ import { BaseModel } from './BaseModel';
|
|
|
5
5
|
export class LeaveAttachments extends BaseModel {
|
|
6
6
|
@Column({ type: 'int', nullable: false })
|
|
7
7
|
leave_request_id: number;
|
|
8
|
-
|
|
9
|
-
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
10
|
-
files: string;
|
|
11
8
|
|
|
12
9
|
@Column({ type: 'int', nullable: false })
|
|
13
10
|
attached_by_user_id: number;
|
|
14
11
|
|
|
15
|
-
|
|
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
|
+
@Column({ type: 'integer', nullable: true })
|
|
25
|
+
chat_id: number | null;
|
|
26
|
+
|
|
27
|
+
constructor(leave_request_id: number, file_url: string, file_name: string, file_type: string, file_size: number | null, chat_id: number | null, attached_by_user_id: number) {
|
|
16
28
|
super();
|
|
17
29
|
this.leave_request_id = leave_request_id;
|
|
18
|
-
this.
|
|
30
|
+
this.file_url = file_url;
|
|
31
|
+
this.file_name = file_name;
|
|
32
|
+
this.file_type = file_type;
|
|
33
|
+
this.file_size = file_size;
|
|
34
|
+
this.chat_id = chat_id;
|
|
19
35
|
this.attached_by_user_id = attached_by_user_id;
|
|
20
36
|
}
|
|
21
37
|
}
|