@platform-modules/foreign-ministry 1.2.21 → 1.2.23
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 +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.js +28 -1
- package/dist/models/MissionTravelApprovalModel.d.ts +3 -0
- package/dist/models/MissionTravelApprovalModel.js +28 -1
- package/dist/models/MissionTravelAttachmentModel.d.ts +5 -3
- package/dist/models/MissionTravelAttachmentModel.js +29 -12
- package/dist/models/MissionTravelChatModel.d.ts +4 -1
- package/dist/models/MissionTravelChatModel.js +23 -3
- package/dist/models/MissionTravelPersonModel.d.ts +2 -8
- package/dist/models/MissionTravelPersonModel.js +4 -15
- package/dist/models/MissionTravelRequestModel.d.ts +2 -6
- package/dist/models/MissionTravelRequestModel.js +7 -27
- package/dist/models/MissionTravelWorkflowModel.d.ts +9 -3
- package/dist/models/MissionTravelWorkflowModel.js +37 -17
- package/package.json +1 -1
- package/src/data-source.ts +11 -1
- package/src/index.ts +7 -1
- package/src/models/EmployeeCardApprovalsModel.ts +87 -0
- package/src/models/EmployeeCardAttachmentsModel.ts +56 -0
- package/src/models/EmployeeCardChatsModel.ts +66 -0
- package/src/models/EmployeeCardRequestsModel.ts +115 -0
- package/src/models/EmployeeCardWorkFlowModel.ts +90 -0
- package/src/models/MissionTravelApprovalModel.ts +41 -0
- package/src/models/MissionTravelAttachmentModel.ts +56 -32
- package/src/models/MissionTravelChatModel.ts +52 -26
- package/src/models/MissionTravelPersonModel.ts +105 -116
- package/src/models/MissionTravelRequestModel.ts +6 -25
- package/src/models/MissionTravelWorkflowModel.ts +55 -38
- package/src/models/MissionTravelClassConfigModel.ts +0 -39
- package/src/models/MissionTravelCostModel.ts +0 -64
- package/src/models/MissionTravelPerdiemModel.ts +0 -43
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Approval Status Enum
|
|
6
|
+
*/
|
|
7
|
+
export enum EmployeeCardApprovalStatus {
|
|
8
|
+
PENDING = "Pending",
|
|
9
|
+
APPROVED = "Approved",
|
|
10
|
+
REJECTED = "Rejected",
|
|
11
|
+
IN_PROGRESS = "In Progress",
|
|
12
|
+
CANCELLED = "Cancelled"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Employee Card Approval Details Table
|
|
17
|
+
* Stores approval information for each level of the workflow
|
|
18
|
+
* Supports workflow: Employee → Department Admin Office → US (if Special) → Security
|
|
19
|
+
*/
|
|
20
|
+
@Entity({ name: 'employee_card_approvals' })
|
|
21
|
+
export class EmployeeCardApprovalDetails extends BaseModel {
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'int', nullable: false })
|
|
24
|
+
employee_card_request_id: number; // Foreign key to employee_card_requests
|
|
25
|
+
|
|
26
|
+
@Column({ type: 'int', nullable: false })
|
|
27
|
+
level: number; // Approval level (1: Dept Admin, 2: US for Special/Security for Normal, 3: Security for Special)
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'int', nullable: true })
|
|
30
|
+
approver_user_id: number | null;
|
|
31
|
+
|
|
32
|
+
@Column({ type: 'int', nullable: true })
|
|
33
|
+
approver_role_id: number | null;
|
|
34
|
+
|
|
35
|
+
@Column({ type: 'integer', nullable: true })
|
|
36
|
+
delegate_user_id: number | null; // If someone is delegating approval
|
|
37
|
+
|
|
38
|
+
@Column({ type: 'integer', nullable: true })
|
|
39
|
+
approved_by: number | null; // Actual user who approved (in case of delegation)
|
|
40
|
+
|
|
41
|
+
@Column({ type: 'int', nullable: true })
|
|
42
|
+
department_id: number | null;
|
|
43
|
+
|
|
44
|
+
@Column({ type: 'int', nullable: true })
|
|
45
|
+
section_id: number | null;
|
|
46
|
+
|
|
47
|
+
@Column({ type: 'text', nullable: true })
|
|
48
|
+
comment: string | null; // Approval/rejection comment
|
|
49
|
+
|
|
50
|
+
@Column({ type: 'enum', enum: EmployeeCardApprovalStatus, default: EmployeeCardApprovalStatus.PENDING, nullable: false })
|
|
51
|
+
approval_status: EmployeeCardApprovalStatus;
|
|
52
|
+
|
|
53
|
+
@Column({ type: 'boolean', default: true, nullable: false })
|
|
54
|
+
is_allowed: boolean; // Whether this approval step is allowed
|
|
55
|
+
|
|
56
|
+
@Column({ type: 'varchar', length: 50, nullable: true })
|
|
57
|
+
access_type: string | null; // Normal or Special - to track which path
|
|
58
|
+
|
|
59
|
+
constructor(
|
|
60
|
+
employee_card_request_id: number,
|
|
61
|
+
level: number,
|
|
62
|
+
approver_user_id: number | null,
|
|
63
|
+
approver_role_id: number | null,
|
|
64
|
+
delegate_user_id: number | null,
|
|
65
|
+
approved_by: number | null,
|
|
66
|
+
department_id: number | null,
|
|
67
|
+
section_id: number | null,
|
|
68
|
+
comment: string | null,
|
|
69
|
+
approval_status: EmployeeCardApprovalStatus,
|
|
70
|
+
is_allowed: boolean,
|
|
71
|
+
access_type: string | null
|
|
72
|
+
) {
|
|
73
|
+
super();
|
|
74
|
+
this.employee_card_request_id = employee_card_request_id;
|
|
75
|
+
this.level = level;
|
|
76
|
+
this.approver_user_id = approver_user_id;
|
|
77
|
+
this.approver_role_id = approver_role_id;
|
|
78
|
+
this.delegate_user_id = delegate_user_id;
|
|
79
|
+
this.approved_by = approved_by;
|
|
80
|
+
this.department_id = department_id;
|
|
81
|
+
this.section_id = section_id;
|
|
82
|
+
this.comment = comment;
|
|
83
|
+
this.approval_status = approval_status;
|
|
84
|
+
this.is_allowed = is_allowed;
|
|
85
|
+
this.access_type = access_type;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
}
|
|
@@ -48,6 +48,47 @@ export class MissionTravelApprovalDetails extends BaseModel {
|
|
|
48
48
|
|
|
49
49
|
@Column({ type: 'boolean', default: true, nullable: false })
|
|
50
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
|
+
}
|
|
51
92
|
}
|
|
52
93
|
|
|
53
94
|
|
|
@@ -1,32 +1,56 @@
|
|
|
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: '
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@Column({ type: 'varchar', length: 500, nullable:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
@Column({ type: 'varchar', length:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@Column({ type: '
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
@Column({ type: '
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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,26 +1,52 @@
|
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
+
|