@platform-modules/foreign-ministry 1.2.26 → 1.2.27
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 +2 -2
- package/dist/data-source.js +1 -11
- package/dist/index.d.ts +0 -19
- package/dist/index.js +1 -28
- package/dist/models/FinancialGradeModel.d.ts +1 -3
- package/dist/models/FinancialGradeModel.js +2 -12
- package/dist/models/LeaveApprovalDetailsModel.d.ts +13 -0
- package/dist/models/LeaveApprovalDetailsModel.js +51 -0
- package/dist/models/LeaveApprovalMatrixModel.d.ts +7 -0
- package/dist/models/LeaveApprovalMatrixModel.js +40 -0
- package/dist/models/UpdateAttendanceAttachmentModel.d.ts +11 -0
- package/dist/models/UpdateAttendanceAttachmentModel.js +52 -0
- package/dist/models/UpdateAttendanceChatModel.d.ts +3 -0
- package/dist/models/UpdateAttendanceChatModel.js +9 -0
- package/dist/models/UpdateAttendenceRequestModel.d.ts +28 -0
- package/dist/models/UpdateAttendenceRequestModel.js +86 -0
- package/package.json +1 -1
- package/src/data-source.ts +1 -11
- package/src/index.ts +1 -21
- package/src/models/FinancialGradeModel.ts +1 -11
- package/src/models/LeaveConfigModel.ts +71 -71
- package/src/models/UpdateAttendanceAttachmentModel.ts +31 -0
- package/src/models/UpdateAttendanceChatModel.ts +7 -1
- package/dist/models/EmployeeCardApprovalsModel.d.ts +0 -31
- package/dist/models/EmployeeCardApprovalsModel.js +0 -100
- package/dist/models/EmployeeCardAttachmentsModel.d.ts +0 -17
- package/dist/models/EmployeeCardAttachmentsModel.js +0 -69
- package/dist/models/EmployeeCardChatsModel.d.ts +0 -19
- package/dist/models/EmployeeCardChatsModel.js +0 -79
- package/dist/models/EmployeeCardRequestsModel.d.ts +0 -40
- package/dist/models/EmployeeCardRequestsModel.js +0 -126
- package/dist/models/EmployeeCardWorkFlowModel.d.ts +0 -34
- package/dist/models/EmployeeCardWorkFlowModel.js +0 -103
- package/dist/models/MissionTravelApprovalModel.d.ts +0 -25
- package/dist/models/MissionTravelApprovalModel.js +0 -106
- package/dist/models/MissionTravelAttachmentModel.d.ts +0 -13
- package/dist/models/MissionTravelAttachmentModel.js +0 -69
- package/dist/models/MissionTravelChatModel.d.ts +0 -12
- package/dist/models/MissionTravelChatModel.js +0 -64
- package/dist/models/MissionTravelClassConfigModel.d.ts +0 -10
- package/dist/models/MissionTravelClassConfigModel.js +0 -50
- package/dist/models/MissionTravelCostModel.d.ts +0 -14
- package/dist/models/MissionTravelCostModel.js +0 -74
- package/dist/models/MissionTravelPerdiemModel.d.ts +0 -10
- package/dist/models/MissionTravelPerdiemModel.js +0 -54
- package/dist/models/MissionTravelPersonModel.d.ts +0 -26
- package/dist/models/MissionTravelPersonModel.js +0 -115
- package/dist/models/MissionTravelRequestModel.d.ts +0 -36
- package/dist/models/MissionTravelRequestModel.js +0 -118
- package/dist/models/MissionTravelWorkflowModel.d.ts +0 -19
- package/dist/models/MissionTravelWorkflowModel.js +0 -80
- package/dist/models/TravelClassEnum.d.ts +0 -5
- package/dist/models/TravelClassEnum.js +0 -9
- package/src/models/EmployeeCardApprovalsModel.ts +0 -87
- package/src/models/EmployeeCardAttachmentsModel.ts +0 -56
- package/src/models/EmployeeCardChatsModel.ts +0 -66
- package/src/models/EmployeeCardRequestsModel.ts +0 -115
- package/src/models/EmployeeCardWorkFlowModel.ts +0 -90
- package/src/models/MissionTravelApprovalModel.ts +0 -94
- package/src/models/MissionTravelAttachmentModel.ts +0 -56
- package/src/models/MissionTravelChatModel.ts +0 -52
- package/src/models/MissionTravelCostModel.ts +0 -61
- package/src/models/MissionTravelPersonModel.ts +0 -105
- package/src/models/MissionTravelRequestModel.ts +0 -107
- package/src/models/MissionTravelWorkflowModel.ts +0 -55
- package/src/models/TravelClassEnum.ts +0 -6
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Employee Card Attachments Table
|
|
6
|
-
* Stores file attachments related to employee card requests
|
|
7
|
-
* Can be attached during initial request or via chat
|
|
8
|
-
*/
|
|
9
|
-
@Entity({ name: 'employee_card_attachments' })
|
|
10
|
-
export class EmployeeCardAttachments extends BaseModel {
|
|
11
|
-
|
|
12
|
-
@Column({ type: 'int', nullable: false })
|
|
13
|
-
employee_card_request_id: number; // Foreign key to employee_card_requests
|
|
14
|
-
|
|
15
|
-
@Column({ type: 'int', nullable: false })
|
|
16
|
-
attached_by_user_id: number; // User who uploaded the attachment
|
|
17
|
-
|
|
18
|
-
@Column({ type: 'varchar', length: 500, nullable: false })
|
|
19
|
-
file_url: string; // URL/path to the file
|
|
20
|
-
|
|
21
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
22
|
-
file_name: string | null; // Original file name
|
|
23
|
-
|
|
24
|
-
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
25
|
-
file_type: string | null; // MIME type (e.g., image/jpeg, application/pdf)
|
|
26
|
-
|
|
27
|
-
@Column({ type: 'bigint', nullable: true })
|
|
28
|
-
file_size: number | null; // File size in bytes
|
|
29
|
-
|
|
30
|
-
@Column({ type: 'integer', nullable: true })
|
|
31
|
-
chat_id: number | null; // Reference to chat message if attached via chat
|
|
32
|
-
|
|
33
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
34
|
-
description: string | null; // Optional description of the attachment
|
|
35
|
-
|
|
36
|
-
constructor(
|
|
37
|
-
employee_card_request_id: number,
|
|
38
|
-
attached_by_user_id: number,
|
|
39
|
-
file_url: string,
|
|
40
|
-
file_name: string | null,
|
|
41
|
-
file_type: string | null,
|
|
42
|
-
file_size: number | null,
|
|
43
|
-
chat_id: number | null,
|
|
44
|
-
description: string | null
|
|
45
|
-
) {
|
|
46
|
-
super();
|
|
47
|
-
this.employee_card_request_id = employee_card_request_id;
|
|
48
|
-
this.attached_by_user_id = attached_by_user_id;
|
|
49
|
-
this.file_url = file_url;
|
|
50
|
-
this.file_name = file_name;
|
|
51
|
-
this.file_type = file_type;
|
|
52
|
-
this.file_size = file_size;
|
|
53
|
-
this.chat_id = chat_id;
|
|
54
|
-
this.description = description;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Employee Card Chat/Communication Table
|
|
6
|
-
* Stores messages/comments between the requester and approvers
|
|
7
|
-
* Allows discussion regarding the employee card request
|
|
8
|
-
*/
|
|
9
|
-
@Entity({ name: 'employee_card_chats' })
|
|
10
|
-
export class EmployeeCardChat extends BaseModel {
|
|
11
|
-
|
|
12
|
-
@Column({ type: 'int', nullable: false })
|
|
13
|
-
employee_card_request_id: number; // Foreign key to employee_card_requests
|
|
14
|
-
|
|
15
|
-
@Column({ type: 'text', nullable: false })
|
|
16
|
-
content: string; // Chat message content
|
|
17
|
-
|
|
18
|
-
@Column({ type: 'int', nullable: false })
|
|
19
|
-
sender_user_id: number; // User who sent the message
|
|
20
|
-
|
|
21
|
-
@Column({ type: 'integer', nullable: true })
|
|
22
|
-
service_id: number | null; // Service context
|
|
23
|
-
|
|
24
|
-
@Column({ type: 'integer', nullable: true })
|
|
25
|
-
sub_service_id: number | null; // Sub-service context
|
|
26
|
-
|
|
27
|
-
@Column({ type: 'integer', nullable: true })
|
|
28
|
-
role_id: number | null; // Role of the sender
|
|
29
|
-
|
|
30
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
31
|
-
status: string | null; // Status of the request at the time of message
|
|
32
|
-
|
|
33
|
-
@Column({ type: 'integer', nullable: true })
|
|
34
|
-
department_id: number | null; // Department of the sender
|
|
35
|
-
|
|
36
|
-
@Column({ type: 'integer', nullable: true })
|
|
37
|
-
section_id: number | null; // Section of the sender
|
|
38
|
-
|
|
39
|
-
@Column({ type: 'boolean', default: false, nullable: true })
|
|
40
|
-
is_internal: boolean | null; // Flag to mark internal notes (visible only to approvers)
|
|
41
|
-
|
|
42
|
-
constructor(
|
|
43
|
-
employee_card_request_id: number,
|
|
44
|
-
content: string,
|
|
45
|
-
sender_user_id: number,
|
|
46
|
-
service_id: number | null,
|
|
47
|
-
sub_service_id: number | null,
|
|
48
|
-
role_id: number | null,
|
|
49
|
-
status: string | null,
|
|
50
|
-
department_id: number | null,
|
|
51
|
-
section_id: number | null,
|
|
52
|
-
is_internal: boolean | null
|
|
53
|
-
) {
|
|
54
|
-
super();
|
|
55
|
-
this.employee_card_request_id = employee_card_request_id;
|
|
56
|
-
this.content = content;
|
|
57
|
-
this.sender_user_id = sender_user_id;
|
|
58
|
-
this.service_id = service_id;
|
|
59
|
-
this.sub_service_id = sub_service_id;
|
|
60
|
-
this.role_id = role_id;
|
|
61
|
-
this.status = status;
|
|
62
|
-
this.department_id = department_id;
|
|
63
|
-
this.section_id = section_id;
|
|
64
|
-
this.is_internal = is_internal;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Employee Card Request Status Enum
|
|
6
|
-
*/
|
|
7
|
-
export enum EmployeeCardRequestStatus {
|
|
8
|
-
PENDING = "Pending",
|
|
9
|
-
APPROVED = "Approved",
|
|
10
|
-
REJECTED = "Rejected",
|
|
11
|
-
CANCELLED = "Cancelled"
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Access Type Enum - Normal or Special
|
|
16
|
-
*/
|
|
17
|
-
export enum AccessType {
|
|
18
|
-
NORMAL = "Normal",
|
|
19
|
-
SPECIAL = "Special"
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Main Employee Card Request Table (FM020)
|
|
24
|
-
* This table stores the primary employee card request data
|
|
25
|
-
*/
|
|
26
|
-
@Entity({ name: 'employee_card_requests' })
|
|
27
|
-
export class EmployeeCardRequests extends BaseModel {
|
|
28
|
-
|
|
29
|
-
// User and Department Information
|
|
30
|
-
@Column({ type: 'int', nullable: false })
|
|
31
|
-
user_id: number;
|
|
32
|
-
|
|
33
|
-
@Column({ type: 'int', nullable: true })
|
|
34
|
-
req_user_department_id: number | null;
|
|
35
|
-
|
|
36
|
-
@Column({ type: 'int', nullable: true })
|
|
37
|
-
req_user_section_id: number | null;
|
|
38
|
-
|
|
39
|
-
@Column({ type: 'int', nullable: true })
|
|
40
|
-
service_id: number | null;
|
|
41
|
-
|
|
42
|
-
@Column({ type: 'int', nullable: true })
|
|
43
|
-
sub_service_id: number | null;
|
|
44
|
-
|
|
45
|
-
// Request Status and Workflow
|
|
46
|
-
@Column({ type: 'enum', enum: EmployeeCardRequestStatus, default: EmployeeCardRequestStatus.PENDING, nullable: false })
|
|
47
|
-
status: EmployeeCardRequestStatus;
|
|
48
|
-
|
|
49
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
50
|
-
workflow_execution_id: string | null;
|
|
51
|
-
|
|
52
|
-
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
53
|
-
number: string | null;
|
|
54
|
-
|
|
55
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
56
|
-
name: string | null;
|
|
57
|
-
|
|
58
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
59
|
-
job_title: string | null;
|
|
60
|
-
|
|
61
|
-
@Column({ type: 'text', nullable: true })
|
|
62
|
-
reason_for_request: string | null;
|
|
63
|
-
|
|
64
|
-
@Column({ type: 'date', nullable: true })
|
|
65
|
-
date_of_joining: Date | null;
|
|
66
|
-
|
|
67
|
-
@Column({ type: 'date', nullable: true })
|
|
68
|
-
date_of_issue: Date | null;
|
|
69
|
-
@Column({ type: 'enum', enum: AccessType, default: AccessType.NORMAL, nullable: false })
|
|
70
|
-
access_type: AccessType; // Normal / Special (Radio Button)
|
|
71
|
-
|
|
72
|
-
// Photo from Profile (URL or reference)
|
|
73
|
-
@Column({ type: 'varchar', length: 500, nullable: true })
|
|
74
|
-
photo_url: string | null; // Photo pulled from profile data
|
|
75
|
-
|
|
76
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
77
|
-
photo_file_name: string | null;
|
|
78
|
-
|
|
79
|
-
constructor(
|
|
80
|
-
user_id: number,
|
|
81
|
-
req_user_department_id: number | null,
|
|
82
|
-
req_user_section_id: number | null,
|
|
83
|
-
service_id: number | null,
|
|
84
|
-
sub_service_id: number | null,
|
|
85
|
-
status: EmployeeCardRequestStatus,
|
|
86
|
-
workflow_execution_id: string | null,
|
|
87
|
-
number: string | null,
|
|
88
|
-
name: string | null,
|
|
89
|
-
job_title: string | null,
|
|
90
|
-
reason_for_request: string | null,
|
|
91
|
-
date_of_joining: Date | null,
|
|
92
|
-
date_of_issue: Date | null,
|
|
93
|
-
access_type: AccessType,
|
|
94
|
-
photo_url: string | null,
|
|
95
|
-
photo_file_name: string | null
|
|
96
|
-
) {
|
|
97
|
-
super();
|
|
98
|
-
this.user_id = user_id;
|
|
99
|
-
this.req_user_department_id = req_user_department_id;
|
|
100
|
-
this.req_user_section_id = req_user_section_id;
|
|
101
|
-
this.service_id = service_id;
|
|
102
|
-
this.sub_service_id = sub_service_id;
|
|
103
|
-
this.status = status;
|
|
104
|
-
this.workflow_execution_id = workflow_execution_id;
|
|
105
|
-
this.number = number;
|
|
106
|
-
this.name = name;
|
|
107
|
-
this.job_title = job_title;
|
|
108
|
-
this.reason_for_request = reason_for_request;
|
|
109
|
-
this.date_of_joining = date_of_joining;
|
|
110
|
-
this.date_of_issue = date_of_issue;
|
|
111
|
-
this.access_type = access_type;
|
|
112
|
-
this.photo_url = photo_url;
|
|
113
|
-
this.photo_file_name = photo_file_name;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Workflow Status Enum
|
|
6
|
-
*/
|
|
7
|
-
export enum EmployeeCardWorkFlowStatus {
|
|
8
|
-
COMPLETED = "Completed",
|
|
9
|
-
NOT_YET_STARTED = "Not Yet Started",
|
|
10
|
-
PENDING = "Pending",
|
|
11
|
-
IN_PROGRESS = "In Progress"
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Employee Card Workflow Table
|
|
16
|
-
* Tracks the progress of the request through different workflow stages
|
|
17
|
-
* Provides a timeline/audit trail of the approval process
|
|
18
|
-
*
|
|
19
|
-
* Workflow paths:
|
|
20
|
-
* - Normal: Employee → Department Admin Office → Security
|
|
21
|
-
* - Special: Employee → Department Admin Office → US → Security
|
|
22
|
-
*/
|
|
23
|
-
@Entity({ name: 'employee_card_work_flows' })
|
|
24
|
-
export class EmployeeCardWorkFlow extends BaseModel {
|
|
25
|
-
|
|
26
|
-
@Column({ type: 'int', nullable: false })
|
|
27
|
-
employee_card_request_id: number; // Foreign key to employee_card_requests
|
|
28
|
-
|
|
29
|
-
@Column({ type: 'int', nullable: false, default: 0 })
|
|
30
|
-
employee_card_approval_details_id: number; // Foreign key to employee_card_approvals
|
|
31
|
-
|
|
32
|
-
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
33
|
-
content: string; // Description of the workflow step (e.g., "Pending Department Admin Office Approval")
|
|
34
|
-
|
|
35
|
-
@Column({ type: 'enum', enum: EmployeeCardWorkFlowStatus, default: EmployeeCardWorkFlowStatus.NOT_YET_STARTED, nullable: false })
|
|
36
|
-
status: EmployeeCardWorkFlowStatus; // Current status of this workflow step
|
|
37
|
-
|
|
38
|
-
@Column({ type: 'integer', nullable: true })
|
|
39
|
-
user_id: number | null; // User responsible for this step
|
|
40
|
-
|
|
41
|
-
@Column({ type: 'integer', nullable: true })
|
|
42
|
-
role_id: number | null; // Role responsible for this step
|
|
43
|
-
|
|
44
|
-
@Column({ type: 'integer', nullable: true })
|
|
45
|
-
department_id: number | null; // Department involved in this step
|
|
46
|
-
|
|
47
|
-
@Column({ type: 'integer', nullable: true })
|
|
48
|
-
section_id: number | null; // Section involved in this step
|
|
49
|
-
|
|
50
|
-
@Column({ type: 'integer', nullable: false, default: 1 })
|
|
51
|
-
level: number; // Workflow level (1: Dept Admin, 2: US/Security, 3: Security for Special)
|
|
52
|
-
|
|
53
|
-
@Column({ type: 'varchar', length: 50, nullable: true })
|
|
54
|
-
access_type: string | null; // Normal or Special - to track workflow path
|
|
55
|
-
|
|
56
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
57
|
-
action_taken: string | null; // Action taken (e.g., "Approved", "Rejected", "Forwarded")
|
|
58
|
-
|
|
59
|
-
@Column({ type: 'timestamptz', nullable: true })
|
|
60
|
-
action_date: Date | null; // When the action was taken
|
|
61
|
-
|
|
62
|
-
constructor(
|
|
63
|
-
employee_card_request_id: number,
|
|
64
|
-
employee_card_approval_details_id: number,
|
|
65
|
-
content: string,
|
|
66
|
-
status: EmployeeCardWorkFlowStatus,
|
|
67
|
-
user_id: number | null,
|
|
68
|
-
role_id: number | null,
|
|
69
|
-
department_id: number | null,
|
|
70
|
-
section_id: number | null,
|
|
71
|
-
level: number,
|
|
72
|
-
access_type: string | null,
|
|
73
|
-
action_taken: string | null,
|
|
74
|
-
action_date: Date | null
|
|
75
|
-
) {
|
|
76
|
-
super();
|
|
77
|
-
this.employee_card_request_id = employee_card_request_id;
|
|
78
|
-
this.employee_card_approval_details_id = employee_card_approval_details_id;
|
|
79
|
-
this.content = content;
|
|
80
|
-
this.status = status;
|
|
81
|
-
this.user_id = user_id;
|
|
82
|
-
this.role_id = role_id;
|
|
83
|
-
this.department_id = department_id;
|
|
84
|
-
this.section_id = section_id;
|
|
85
|
-
this.level = level;
|
|
86
|
-
this.access_type = access_type;
|
|
87
|
-
this.action_taken = action_taken;
|
|
88
|
-
this.action_date = action_date;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
export enum MissionTravelApprovalStatus {
|
|
5
|
-
PENDING = "Pending",
|
|
6
|
-
APPROVED = "Approved",
|
|
7
|
-
REJECTED = "Rejected",
|
|
8
|
-
RFC = "RFC" // Request for Change
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@Entity({ name: 'mission_travel_approvals' })
|
|
12
|
-
export class MissionTravelApprovalDetails 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: 'integer', nullable: false })
|
|
23
|
-
level: number;
|
|
24
|
-
|
|
25
|
-
@Column({ type: 'integer', nullable: true })
|
|
26
|
-
approver_role_id: number;
|
|
27
|
-
|
|
28
|
-
@Column({ type: 'integer', nullable: true })
|
|
29
|
-
department_id: number | null;
|
|
30
|
-
|
|
31
|
-
@Column({ type: 'integer', nullable: true })
|
|
32
|
-
section_id: number | null;
|
|
33
|
-
|
|
34
|
-
@Column({ type: 'integer', nullable: true })
|
|
35
|
-
approver_user_id: number | null;
|
|
36
|
-
|
|
37
|
-
@Column({ type: 'integer', nullable: true })
|
|
38
|
-
delegate_user_id: number | null;
|
|
39
|
-
|
|
40
|
-
@Column({ type: 'integer', nullable: true })
|
|
41
|
-
approved_by: number | null;
|
|
42
|
-
|
|
43
|
-
@Column({ type: 'varchar', length: 500, nullable: true, default: '' })
|
|
44
|
-
comment: string;
|
|
45
|
-
|
|
46
|
-
@Column({ type: 'enum', enum: MissionTravelApprovalStatus, default: MissionTravelApprovalStatus.PENDING, nullable: false })
|
|
47
|
-
approval_status: MissionTravelApprovalStatus;
|
|
48
|
-
|
|
49
|
-
@Column({ type: 'boolean', default: true, nullable: false })
|
|
50
|
-
is_allowed: boolean;
|
|
51
|
-
|
|
52
|
-
@Column({ type: 'boolean', default: false, nullable: false })
|
|
53
|
-
is_reassign: boolean;
|
|
54
|
-
|
|
55
|
-
@Column({ type: 'boolean', default: true, nullable: false })
|
|
56
|
-
is_approval: boolean;
|
|
57
|
-
|
|
58
|
-
constructor(
|
|
59
|
-
request_id: number,
|
|
60
|
-
service_id: number | null,
|
|
61
|
-
sub_service_id: number | null,
|
|
62
|
-
level: number,
|
|
63
|
-
approver_role_id: number,
|
|
64
|
-
department_id: number | null,
|
|
65
|
-
section_id: number | null,
|
|
66
|
-
approver_user_id: number | null,
|
|
67
|
-
delegate_user_id: number | null,
|
|
68
|
-
approved_by: number | null,
|
|
69
|
-
comment: string,
|
|
70
|
-
approval_status: MissionTravelApprovalStatus,
|
|
71
|
-
is_allowed: boolean,
|
|
72
|
-
is_reassign: boolean,
|
|
73
|
-
is_approval: boolean
|
|
74
|
-
) {
|
|
75
|
-
super();
|
|
76
|
-
this.request_id = request_id;
|
|
77
|
-
this.service_id = service_id;
|
|
78
|
-
this.sub_service_id = sub_service_id;
|
|
79
|
-
this.level = level;
|
|
80
|
-
this.approver_role_id = approver_role_id;
|
|
81
|
-
this.department_id = department_id;
|
|
82
|
-
this.section_id = section_id;
|
|
83
|
-
this.approver_user_id = approver_user_id;
|
|
84
|
-
this.delegate_user_id = delegate_user_id;
|
|
85
|
-
this.approved_by = approved_by;
|
|
86
|
-
this.comment = comment;
|
|
87
|
-
this.approval_status = approval_status;
|
|
88
|
-
this.is_allowed = is_allowed;
|
|
89
|
-
this.is_reassign = is_reassign;
|
|
90
|
-
this.is_approval = is_approval;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
@Entity({ name: 'mission_travel_attachments' })
|
|
5
|
-
export class MissionTravelRequestAttachment extends BaseModel {
|
|
6
|
-
@Column({ type: 'integer', nullable: false })
|
|
7
|
-
request_id: number;
|
|
8
|
-
|
|
9
|
-
@Column({ type: 'integer', nullable: true })
|
|
10
|
-
service_id: number | null;
|
|
11
|
-
|
|
12
|
-
@Column({ type: 'integer', nullable: true })
|
|
13
|
-
sub_service_id: number | null;
|
|
14
|
-
|
|
15
|
-
@Column({ type: 'integer', nullable: false })
|
|
16
|
-
uploaded_by: number;
|
|
17
|
-
|
|
18
|
-
@Column({ type: 'varchar', length: 500, nullable: false })
|
|
19
|
-
file_url: string;
|
|
20
|
-
|
|
21
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
22
|
-
file_name: string;
|
|
23
|
-
|
|
24
|
-
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
25
|
-
file_type: string;
|
|
26
|
-
|
|
27
|
-
@Column({ type: 'bigint', nullable: true })
|
|
28
|
-
file_size: number | null;
|
|
29
|
-
|
|
30
|
-
@Column({ type: 'text', nullable: true })
|
|
31
|
-
description: string;
|
|
32
|
-
|
|
33
|
-
constructor(
|
|
34
|
-
request_id: number,
|
|
35
|
-
uploaded_by: number,
|
|
36
|
-
file_url: string,
|
|
37
|
-
file_name?: string,
|
|
38
|
-
file_type?: string,
|
|
39
|
-
file_size?: number,
|
|
40
|
-
description?: string,
|
|
41
|
-
service_id?: number | null,
|
|
42
|
-
sub_service_id?: number | null
|
|
43
|
-
) {
|
|
44
|
-
super();
|
|
45
|
-
this.request_id = request_id;
|
|
46
|
-
this.uploaded_by = uploaded_by;
|
|
47
|
-
this.file_url = file_url;
|
|
48
|
-
this.file_name = file_name || '';
|
|
49
|
-
this.file_type = file_type || '';
|
|
50
|
-
this.file_size = file_size || null;
|
|
51
|
-
this.description = description || '';
|
|
52
|
-
this.service_id = service_id ?? null;
|
|
53
|
-
this.sub_service_id = sub_service_id ?? null;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
@Entity({ name: 'mission_travel_chats' })
|
|
5
|
-
export class MissionTravelRequestChat 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: 'integer', nullable: false })
|
|
17
|
-
user_id: number;
|
|
18
|
-
|
|
19
|
-
@Column({ type: 'integer', nullable: true })
|
|
20
|
-
role_id: number | null;
|
|
21
|
-
|
|
22
|
-
@Column({ type: 'text', nullable: false })
|
|
23
|
-
message: string;
|
|
24
|
-
|
|
25
|
-
@Column({ type: 'text', nullable: true })
|
|
26
|
-
status: string | null;
|
|
27
|
-
|
|
28
|
-
@Column({ type: 'boolean', default: false })
|
|
29
|
-
is_internal: boolean;
|
|
30
|
-
|
|
31
|
-
constructor(
|
|
32
|
-
request_id: number,
|
|
33
|
-
user_id: number,
|
|
34
|
-
message: string,
|
|
35
|
-
is_internal?: boolean,
|
|
36
|
-
service_id?: number | null,
|
|
37
|
-
sub_service_id?: number | null,
|
|
38
|
-
role_id?: number | null,
|
|
39
|
-
status?: string | null
|
|
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.user_id = user_id;
|
|
46
|
-
this.role_id = role_id || null;
|
|
47
|
-
this.message = message;
|
|
48
|
-
this.status = status || null;
|
|
49
|
-
this.is_internal = is_internal || false;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
@Entity({ name: 'mission_travel_costs' })
|
|
5
|
-
export class MissionTravelCosts extends BaseModel {
|
|
6
|
-
@Column({ type: 'integer', nullable: false })
|
|
7
|
-
request_id: number;
|
|
8
|
-
|
|
9
|
-
@Column({ type: 'integer', nullable: true })
|
|
10
|
-
service_id: number | null;
|
|
11
|
-
|
|
12
|
-
@Column({ type: 'integer', nullable: true })
|
|
13
|
-
sub_service_id: number | null;
|
|
14
|
-
|
|
15
|
-
@Column({ type: 'integer', nullable: false })
|
|
16
|
-
person_id: number;
|
|
17
|
-
|
|
18
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
19
|
-
person_name: string | null;
|
|
20
|
-
|
|
21
|
-
@Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
|
|
22
|
-
allowance_amount: number | null;
|
|
23
|
-
|
|
24
|
-
@Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
|
|
25
|
-
ticket_charges: number | null;
|
|
26
|
-
|
|
27
|
-
@Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
|
|
28
|
-
hotel_charges: number | null;
|
|
29
|
-
|
|
30
|
-
@Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
|
|
31
|
-
others: number | null;
|
|
32
|
-
|
|
33
|
-
@Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
|
|
34
|
-
sub_total: number | null;
|
|
35
|
-
|
|
36
|
-
constructor(
|
|
37
|
-
request_id: number,
|
|
38
|
-
person_id: number,
|
|
39
|
-
service_id?: number | null,
|
|
40
|
-
sub_service_id?: number | null,
|
|
41
|
-
person_name?: string | null,
|
|
42
|
-
allowance_amount?: number | null,
|
|
43
|
-
ticket_charges?: number | null,
|
|
44
|
-
hotel_charges?: number | null,
|
|
45
|
-
others?: number | null,
|
|
46
|
-
sub_total?: number | null
|
|
47
|
-
) {
|
|
48
|
-
super();
|
|
49
|
-
this.request_id = request_id;
|
|
50
|
-
this.person_id = person_id;
|
|
51
|
-
this.service_id = service_id ?? null;
|
|
52
|
-
this.sub_service_id = sub_service_id ?? null;
|
|
53
|
-
this.person_name = person_name || null;
|
|
54
|
-
this.allowance_amount = allowance_amount || null;
|
|
55
|
-
this.ticket_charges = ticket_charges || null;
|
|
56
|
-
this.hotel_charges = hotel_charges || null;
|
|
57
|
-
this.others = others || null;
|
|
58
|
-
this.sub_total = sub_total || null;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
export enum AllowanceRatio {
|
|
5
|
-
RATIO_100 = "100",
|
|
6
|
-
RATIO_75 = "75",
|
|
7
|
-
RATIO_50 = "50"
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@Entity({ name: 'mission_travel_persons' })
|
|
11
|
-
export class MissionTravelPersons extends BaseModel {
|
|
12
|
-
|
|
13
|
-
@Column({ type: 'int', nullable: false })
|
|
14
|
-
request_id: number;
|
|
15
|
-
|
|
16
|
-
@Column({ type: 'int', nullable: true })
|
|
17
|
-
service_id: number | null;
|
|
18
|
-
|
|
19
|
-
@Column({ type: 'int', nullable: true })
|
|
20
|
-
sub_service_id: number | null;
|
|
21
|
-
|
|
22
|
-
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
23
|
-
travel_person_name: string;
|
|
24
|
-
|
|
25
|
-
@Column({ type: 'int', nullable: true })
|
|
26
|
-
user_id: number | null; // If employee, link to user table
|
|
27
|
-
|
|
28
|
-
@Column({ type: 'int', nullable: true })
|
|
29
|
-
country_id: number | null;
|
|
30
|
-
|
|
31
|
-
@Column({ type: 'varchar', length: 10, nullable: true })
|
|
32
|
-
allowance_ratio: AllowanceRatio | null; // 100, 75, or 50
|
|
33
|
-
|
|
34
|
-
@Column({ type: 'date', nullable: true })
|
|
35
|
-
travel_from_date: Date | null;
|
|
36
|
-
|
|
37
|
-
@Column({ type: 'date', nullable: true })
|
|
38
|
-
travel_to_date: Date | null;
|
|
39
|
-
|
|
40
|
-
@Column({ type: 'varchar', nullable: true })
|
|
41
|
-
travel_class: string | null;
|
|
42
|
-
|
|
43
|
-
@Column({ type: 'int', nullable: true })
|
|
44
|
-
number_of_days: number | null;
|
|
45
|
-
|
|
46
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
47
|
-
hotel_name: string | null;
|
|
48
|
-
|
|
49
|
-
@Column({ type: 'int', nullable: true })
|
|
50
|
-
hotel_rating: number | null;
|
|
51
|
-
|
|
52
|
-
@Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
|
|
53
|
-
hotel_price: number | null;
|
|
54
|
-
|
|
55
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
56
|
-
travel_agent_name: string | null;
|
|
57
|
-
|
|
58
|
-
@Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
|
|
59
|
-
allowance_amount: number | null; // Auto-calculated based on ratio & perdiem
|
|
60
|
-
|
|
61
|
-
@Column({ type: 'int', nullable: true })
|
|
62
|
-
grade: number | null; // Employee grade for perdiem calculation
|
|
63
|
-
|
|
64
|
-
constructor(
|
|
65
|
-
request_id: number,
|
|
66
|
-
service_id: number | null,
|
|
67
|
-
sub_service_id: number | null,
|
|
68
|
-
travel_person_name: string,
|
|
69
|
-
user_id: number | null,
|
|
70
|
-
country_id: number | null,
|
|
71
|
-
allowance_ratio: AllowanceRatio | null,
|
|
72
|
-
travel_from_date: Date | null,
|
|
73
|
-
travel_to_date: Date | null,
|
|
74
|
-
travel_class: string | null,
|
|
75
|
-
number_of_days: number | null,
|
|
76
|
-
hotel_name: string | null,
|
|
77
|
-
hotel_rating: number | null,
|
|
78
|
-
hotel_price: number | null,
|
|
79
|
-
travel_agent_name: string | null,
|
|
80
|
-
allowance_amount: number | null,
|
|
81
|
-
grade: number | null
|
|
82
|
-
) {
|
|
83
|
-
super();
|
|
84
|
-
this.request_id = request_id;
|
|
85
|
-
this.service_id = service_id;
|
|
86
|
-
this.sub_service_id = sub_service_id;
|
|
87
|
-
this.travel_person_name = travel_person_name;
|
|
88
|
-
this.user_id = user_id;
|
|
89
|
-
this.country_id = country_id;
|
|
90
|
-
this.allowance_ratio = allowance_ratio;
|
|
91
|
-
this.travel_from_date = travel_from_date;
|
|
92
|
-
this.travel_to_date = travel_to_date;
|
|
93
|
-
this.travel_class = travel_class;
|
|
94
|
-
this.number_of_days = number_of_days;
|
|
95
|
-
this.hotel_name = hotel_name;
|
|
96
|
-
this.hotel_rating = hotel_rating;
|
|
97
|
-
this.hotel_price = hotel_price;
|
|
98
|
-
this.travel_agent_name = travel_agent_name;
|
|
99
|
-
this.allowance_amount = allowance_amount;
|
|
100
|
-
this.grade = grade;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|