@platform-modules/foreign-ministry 1.2.100 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +17 -3
- package/dist/data-source.js +5 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.js +18 -1
- package/dist/models/DiplomaticRequestsModel.d.ts +1 -0
- package/dist/models/DiplomaticRequestsModel.js +4 -0
- package/dist/models/GeneralServiceChatsModel.d.ts +3 -1
- package/dist/models/GeneralServiceChatsModel.js +12 -2
- package/dist/models/HelpContentMappedCategoriesModel.d.ts +6 -0
- package/dist/models/HelpContentMappedCategoriesModel.js +34 -0
- package/dist/models/HelpContentMappedTagsModel.d.ts +6 -0
- package/dist/models/HelpContentMappedTagsModel.js +34 -0
- package/dist/models/HelpContentTagsModel.d.ts +5 -0
- package/dist/models/HelpContentTagsModel.js +29 -0
- package/dist/models/HelpdeskAutoClosureConfig.d.ts +12 -0
- package/dist/models/HelpdeskAutoClosureConfig.js +59 -0
- package/dist/models/HelpdeskKnowledgeBase.d.ts +13 -0
- package/dist/models/HelpdeskKnowledgeBase.js +61 -0
- package/dist/models/MissionTravelApprovalModel.d.ts +1 -2
- package/dist/models/MissionTravelApprovalModel.js +1 -2
- package/dist/models/RegisterVacancyRequestModel.d.ts +1 -0
- package/dist/models/RegisterVacancyRequestModel.js +4 -0
- package/dist/models/RequestParcelRequestModel.d.ts +7 -1
- package/dist/models/RequestParcelRequestModel.js +9 -0
- package/dist/models/RequestPassportRequestModel.d.ts +0 -11
- package/dist/models/RequestPassportRequestModel.js +0 -44
- package/dist/models/RetiredCardApprovalsModel.d.ts +33 -0
- package/dist/models/RetiredCardApprovalsModel.js +110 -0
- package/dist/models/RetiredCardAttachmentsModel.d.ts +16 -0
- package/dist/models/RetiredCardAttachmentsModel.js +60 -0
- package/dist/models/RetiredCardChatsModel.d.ts +26 -0
- package/dist/models/RetiredCardChatsModel.js +84 -0
- package/dist/models/RetiredCardRequestsModel.d.ts +39 -0
- package/dist/models/RetiredCardRequestsModel.js +117 -0
- package/dist/models/RetiredCardWorkFlowModel.d.ts +33 -0
- package/dist/models/RetiredCardWorkFlowModel.js +93 -0
- package/dist/models/SectionModel.d.ts +2 -1
- package/dist/models/SectionModel.js +7 -2
- package/dist/models/questionTagsModel.d.ts +6 -0
- package/dist/models/questionTagsModel.js +34 -0
- package/package.json +1 -1
- package/src/data-source.ts +273 -268
- package/src/index.ts +12 -0
- package/src/models/DiplomaticRequestsModel.ts +3 -0
- package/src/models/GeneralServiceChatsModel.ts +11 -1
- package/src/models/HelpdeskAutoClosureConfig.ts +41 -0
- package/src/models/HelpdeskKnowledgeBase.ts +46 -0
- package/src/models/LeaveConfigModel.ts +71 -71
- package/src/models/MissionTravelApprovalModel.ts +94 -95
- package/src/models/MissionTravelAttachmentModel.ts +56 -56
- package/src/models/MissionTravelChatModel.ts +52 -52
- package/src/models/MissionTravelPersonModel.ts +105 -105
- package/src/models/MissionTravelRequestModel.ts +0 -1
- package/src/models/MissionTravelWorkflowModel.ts +54 -54
- package/src/models/RegisterVacancyRequestModel.ts +3 -0
- package/src/models/RequestParcelRequestModel.ts +8 -0
- package/src/models/RequestPassportRequestModel.ts +22 -22
- package/src/models/RetiredCardApprovalsModel.ts +98 -0
- package/src/models/RetiredCardAttachmentsModel.ts +38 -0
- package/src/models/RetiredCardChatsModel.ts +72 -0
- package/src/models/RetiredCardRequestsModel.ts +109 -0
- package/src/models/RetiredCardWorkFlowModel.ts +66 -0
- package/src/models/SectionModel.ts +6 -1
- package/dist/models/MissionTravelClassConfigModel.d.ts +0 -10
- package/dist/models/MissionTravelClassConfigModel.js +0 -50
- package/dist/models/MissionTravelPerdiemModel.d.ts +0 -10
- package/dist/models/MissionTravelPerdiemModel.js +0 -54
- /package/src/models/{LeaveConfigGradesModel.Ts → LeaveConfigGradesModel.ts} +0 -0
|
@@ -1,105 +1,105 @@
|
|
|
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
|
-
|
|
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
|
+
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
export enum MissionTravelWorkFlowStatus {
|
|
5
|
-
COMPLETED = "Completed",
|
|
6
|
-
NOT_YET_STARTED = "Not Yet Started",
|
|
7
|
-
PENDING = "Pending"
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@Entity({ name: 'mission_travel_workflows' })
|
|
11
|
-
export class MissionTravelWorkFlow extends BaseModel {
|
|
12
|
-
@Column({ type: 'int', nullable: false })
|
|
13
|
-
request_id: number;
|
|
14
|
-
|
|
15
|
-
@Column({ type: 'int', nullable: true })
|
|
16
|
-
service_id: number | null;
|
|
17
|
-
|
|
18
|
-
@Column({ type: 'int', nullable: true })
|
|
19
|
-
sub_service_id: number | null;
|
|
20
|
-
|
|
21
|
-
@Column({ type: 'int', nullable: true })
|
|
22
|
-
order: number | null;
|
|
23
|
-
|
|
24
|
-
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
25
|
-
content: string;
|
|
26
|
-
|
|
27
|
-
@Column({ type: 'enum', enum: MissionTravelWorkFlowStatus, default: MissionTravelWorkFlowStatus.NOT_YET_STARTED, nullable: false })
|
|
28
|
-
status: MissionTravelWorkFlowStatus;
|
|
29
|
-
|
|
30
|
-
@Column({ type: 'integer', nullable: true })
|
|
31
|
-
user_id: number | null;
|
|
32
|
-
|
|
33
|
-
@Column({ type: 'integer', nullable: true })
|
|
34
|
-
role_id: number | null;
|
|
35
|
-
|
|
36
|
-
@Column({ type: 'integer', nullable: true })
|
|
37
|
-
department_id: number | null;
|
|
38
|
-
|
|
39
|
-
@Column({ type: 'integer', nullable: true })
|
|
40
|
-
section_id: number | null;
|
|
41
|
-
|
|
42
|
-
constructor(request_id: number, content: string, status: MissionTravelWorkFlowStatus, order?: number, service_id?: number | null, sub_service_id?: number | null, user_id?: number | null, role_id?: number | null, department_id?: number | null, section_id?: number | null) {
|
|
43
|
-
super();
|
|
44
|
-
this.request_id = request_id;
|
|
45
|
-
this.content = content;
|
|
46
|
-
this.status = status;
|
|
47
|
-
this.order = order || null;
|
|
48
|
-
this.service_id = service_id ?? null;
|
|
49
|
-
this.sub_service_id = sub_service_id ?? null;
|
|
50
|
-
this.user_id = user_id || null;
|
|
51
|
-
this.role_id = role_id || null;
|
|
52
|
-
this.department_id = department_id || null;
|
|
53
|
-
this.section_id = section_id || null;
|
|
54
|
-
}
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum MissionTravelWorkFlowStatus {
|
|
5
|
+
COMPLETED = "Completed",
|
|
6
|
+
NOT_YET_STARTED = "Not Yet Started",
|
|
7
|
+
PENDING = "Pending"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@Entity({ name: 'mission_travel_workflows' })
|
|
11
|
+
export class MissionTravelWorkFlow extends BaseModel {
|
|
12
|
+
@Column({ type: 'int', nullable: false })
|
|
13
|
+
request_id: number;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'int', nullable: true })
|
|
16
|
+
service_id: number | null;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'int', nullable: true })
|
|
19
|
+
sub_service_id: number | null;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'int', nullable: true })
|
|
22
|
+
order: number | null;
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
25
|
+
content: string;
|
|
26
|
+
|
|
27
|
+
@Column({ type: 'enum', enum: MissionTravelWorkFlowStatus, default: MissionTravelWorkFlowStatus.NOT_YET_STARTED, nullable: false })
|
|
28
|
+
status: MissionTravelWorkFlowStatus;
|
|
29
|
+
|
|
30
|
+
@Column({ type: 'integer', nullable: true })
|
|
31
|
+
user_id: number | null;
|
|
32
|
+
|
|
33
|
+
@Column({ type: 'integer', nullable: true })
|
|
34
|
+
role_id: number | null;
|
|
35
|
+
|
|
36
|
+
@Column({ type: 'integer', nullable: true })
|
|
37
|
+
department_id: number | null;
|
|
38
|
+
|
|
39
|
+
@Column({ type: 'integer', nullable: true })
|
|
40
|
+
section_id: number | null;
|
|
41
|
+
|
|
42
|
+
constructor(request_id: number, content: string, status: MissionTravelWorkFlowStatus, order?: number, service_id?: number | null, sub_service_id?: number | null, user_id?: number | null, role_id?: number | null, department_id?: number | null, section_id?: number | null) {
|
|
43
|
+
super();
|
|
44
|
+
this.request_id = request_id;
|
|
45
|
+
this.content = content;
|
|
46
|
+
this.status = status;
|
|
47
|
+
this.order = order || null;
|
|
48
|
+
this.service_id = service_id ?? null;
|
|
49
|
+
this.sub_service_id = sub_service_id ?? null;
|
|
50
|
+
this.user_id = user_id || null;
|
|
51
|
+
this.role_id = role_id || null;
|
|
52
|
+
this.department_id = department_id || null;
|
|
53
|
+
this.section_id = section_id || null;
|
|
54
|
+
}
|
|
55
55
|
}
|
|
@@ -40,6 +40,9 @@ export class RegisterVacancyRequests extends BaseModel {
|
|
|
40
40
|
@Column({ type: 'varchar', nullable: false })
|
|
41
41
|
salary: string;
|
|
42
42
|
|
|
43
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
44
|
+
currency_type: string | null;
|
|
45
|
+
|
|
43
46
|
@Column({ type: 'text', nullable: false })
|
|
44
47
|
position_details: string;
|
|
45
48
|
|
|
@@ -5,6 +5,11 @@ export enum RequestParcelStatus {
|
|
|
5
5
|
SUBMITTED = "Submitted",
|
|
6
6
|
IN_TRANSIT = "In Transit",
|
|
7
7
|
RECEIVED = "Received",
|
|
8
|
+
PENDING = "Pending",
|
|
9
|
+
ASSIGNED = "Assigned",
|
|
10
|
+
IN_PROGRESS = "In Progress",
|
|
11
|
+
APPROVED = "Approved",
|
|
12
|
+
REJECTED = "Rejected"
|
|
8
13
|
}
|
|
9
14
|
|
|
10
15
|
export enum ImportanceOfPouchType {
|
|
@@ -48,6 +53,9 @@ export class RequestParcelRequests extends BaseModel {
|
|
|
48
53
|
@Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
|
|
49
54
|
price: number | null;
|
|
50
55
|
|
|
56
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
57
|
+
currency_type: string | null;
|
|
58
|
+
|
|
51
59
|
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
52
60
|
shipment_courier_number: string | null;
|
|
53
61
|
|
|
@@ -70,38 +70,38 @@ export class RequestPassportRequests extends BaseModel {
|
|
|
70
70
|
@Column({ type: 'int', nullable: false })
|
|
71
71
|
approved_mission_travel_id: number;
|
|
72
72
|
|
|
73
|
-
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
74
|
-
first_name: string;
|
|
73
|
+
// @Column({ type: 'varchar', length: 255, nullable: false })
|
|
74
|
+
// first_name: string;
|
|
75
75
|
|
|
76
|
-
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
77
|
-
family_name: string;
|
|
76
|
+
// @Column({ type: 'varchar', length: 255, nullable: false })
|
|
77
|
+
// family_name: string;
|
|
78
78
|
|
|
79
|
-
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
80
|
-
last_name: string;
|
|
79
|
+
// @Column({ type: 'varchar', length: 255, nullable: false })
|
|
80
|
+
// last_name: string;
|
|
81
81
|
|
|
82
|
-
@Column({ type: 'varchar', length: 50, nullable: false })
|
|
83
|
-
gender: string;
|
|
82
|
+
// @Column({ type: 'varchar', length: 50, nullable: false })
|
|
83
|
+
// gender: string;
|
|
84
84
|
|
|
85
|
-
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
86
|
-
nationality: string;
|
|
85
|
+
// @Column({ type: 'varchar', length: 255, nullable: false })
|
|
86
|
+
// nationality: string;
|
|
87
87
|
|
|
88
|
-
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
89
|
-
place_of_birth: string;
|
|
88
|
+
// @Column({ type: 'varchar', length: 255, nullable: false })
|
|
89
|
+
// place_of_birth: string;
|
|
90
90
|
|
|
91
|
-
@Column({ type: 'date', nullable: true })
|
|
92
|
-
date_of_birth: Date | null;
|
|
91
|
+
// @Column({ type: 'date', nullable: true })
|
|
92
|
+
// date_of_birth: Date | null;
|
|
93
93
|
|
|
94
|
-
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
95
|
-
job_occupation: string;
|
|
94
|
+
// @Column({ type: 'varchar', length: 255, nullable: false })
|
|
95
|
+
// job_occupation: string;
|
|
96
96
|
|
|
97
|
-
@Column({ type: 'enum', enum: RelationType, nullable: true })
|
|
98
|
-
relation_type: RelationType | null;
|
|
97
|
+
// @Column({ type: 'enum', enum: RelationType, nullable: true })
|
|
98
|
+
// relation_type: RelationType | null;
|
|
99
99
|
|
|
100
|
-
@Column({ type: 'int', nullable: false })
|
|
101
|
-
age: number;
|
|
100
|
+
// @Column({ type: 'int', nullable: false })
|
|
101
|
+
// age: number;
|
|
102
102
|
|
|
103
|
-
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
104
|
-
passport_request_type: string;
|
|
103
|
+
// @Column({ type: 'varchar', length: 255, nullable: false })
|
|
104
|
+
// passport_request_type: string;
|
|
105
105
|
|
|
106
106
|
@Column({ type: 'enum', enum: RequestPassportStatus, default: RequestPassportStatus.PENDING, nullable: false })
|
|
107
107
|
status: RequestPassportStatus;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Retired Card Approval Status Enum
|
|
6
|
+
*/
|
|
7
|
+
export enum RetiredCardApprovalStatus {
|
|
8
|
+
PENDING = "Pending",
|
|
9
|
+
IN_PROGRESS = "In Progress",
|
|
10
|
+
APPROVED = "Approved",
|
|
11
|
+
REJECTED = "Rejected",
|
|
12
|
+
CANCELLED = "Cancelled"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Retired Card Approval Details Table
|
|
17
|
+
* Stores approval information for each level of the workflow
|
|
18
|
+
* Workflow: Employee → Security Department (no approval cycle required, but table exists for consistency)
|
|
19
|
+
*/
|
|
20
|
+
@Entity({ name: 'retired_card_approvals' })
|
|
21
|
+
export class RetiredCardApprovalDetails extends BaseModel {
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'int', nullable: false })
|
|
24
|
+
retired_card_request_id: number; // Foreign key to retired_card_requests
|
|
25
|
+
|
|
26
|
+
@Column({ type: 'int', nullable: false })
|
|
27
|
+
level: number; // Approval level (1: Security Department)
|
|
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: RetiredCardApprovalStatus, default: RetiredCardApprovalStatus.PENDING, nullable: false })
|
|
51
|
+
approval_status: RetiredCardApprovalStatus;
|
|
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 - to track access type
|
|
58
|
+
|
|
59
|
+
@Column({ type: 'integer', nullable: true })
|
|
60
|
+
service_id: number | null;
|
|
61
|
+
|
|
62
|
+
@Column({ type: 'integer', nullable: true })
|
|
63
|
+
sub_service_id: number | null;
|
|
64
|
+
|
|
65
|
+
constructor(
|
|
66
|
+
retired_card_request_id: number,
|
|
67
|
+
level: number,
|
|
68
|
+
approver_user_id: number | null,
|
|
69
|
+
approver_role_id: number | null,
|
|
70
|
+
delegate_user_id: number | null,
|
|
71
|
+
approved_by: number | null,
|
|
72
|
+
department_id: number | null,
|
|
73
|
+
section_id: number | null,
|
|
74
|
+
comment: string | null,
|
|
75
|
+
approval_status: RetiredCardApprovalStatus,
|
|
76
|
+
is_allowed: boolean,
|
|
77
|
+
access_type: string | null,
|
|
78
|
+
service_id: number | null,
|
|
79
|
+
sub_service_id: number | null
|
|
80
|
+
) {
|
|
81
|
+
super();
|
|
82
|
+
this.retired_card_request_id = retired_card_request_id;
|
|
83
|
+
this.level = level;
|
|
84
|
+
this.approver_user_id = approver_user_id;
|
|
85
|
+
this.approver_role_id = approver_role_id;
|
|
86
|
+
this.delegate_user_id = delegate_user_id;
|
|
87
|
+
this.approved_by = approved_by;
|
|
88
|
+
this.department_id = department_id;
|
|
89
|
+
this.section_id = section_id;
|
|
90
|
+
this.comment = comment;
|
|
91
|
+
this.approval_status = approval_status;
|
|
92
|
+
this.is_allowed = is_allowed;
|
|
93
|
+
this.access_type = access_type;
|
|
94
|
+
this.service_id = service_id;
|
|
95
|
+
this.sub_service_id = sub_service_id;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Retired Card Request Attachment Table
|
|
6
|
+
* Stores file attachments for retired card requests
|
|
7
|
+
*/
|
|
8
|
+
@Entity({ name: 'retired_card_attachments' })
|
|
9
|
+
export class RetiredCardRequestAttachment extends BaseModel {
|
|
10
|
+
|
|
11
|
+
@Column({ type: 'integer', nullable: false })
|
|
12
|
+
request_id: number;
|
|
13
|
+
|
|
14
|
+
@Column({ type: 'integer', nullable: true })
|
|
15
|
+
service_id: number | null;
|
|
16
|
+
|
|
17
|
+
@Column({ type: 'integer', nullable: true })
|
|
18
|
+
sub_service_id: number | null;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'varchar', length: 500, nullable: false })
|
|
21
|
+
file_url: string;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
24
|
+
file_name: string;
|
|
25
|
+
|
|
26
|
+
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
27
|
+
file_type: string;
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'bigint', nullable: true })
|
|
30
|
+
file_size: number | null;
|
|
31
|
+
|
|
32
|
+
@Column({ type: 'integer', nullable: true })
|
|
33
|
+
chat_id: number | null;
|
|
34
|
+
|
|
35
|
+
@Column({ type: 'text', nullable: true })
|
|
36
|
+
description: string | null; // Optional description for the attachment
|
|
37
|
+
}
|
|
38
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Retired Card Message Type Enum
|
|
6
|
+
*/
|
|
7
|
+
export enum RetiredCardMessageType {
|
|
8
|
+
TEXT = "text",
|
|
9
|
+
IMAGE = "image",
|
|
10
|
+
VIDEO = "video",
|
|
11
|
+
FILE = "file",
|
|
12
|
+
LINK = "link"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Retired Card Request Chat Table
|
|
17
|
+
* Stores chat messages for retired card requests
|
|
18
|
+
*/
|
|
19
|
+
@Entity({ name: 'retired_card_chats' })
|
|
20
|
+
export class RetiredCardRequestChat extends BaseModel {
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'integer', nullable: false })
|
|
23
|
+
request_id: number;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'integer', nullable: true })
|
|
26
|
+
service_id: number | null;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'integer', nullable: true })
|
|
29
|
+
sub_service_id: number | null;
|
|
30
|
+
|
|
31
|
+
@Column({ type: 'integer', nullable: false })
|
|
32
|
+
user_id: number;
|
|
33
|
+
|
|
34
|
+
@Column({ type: 'integer', nullable: true })
|
|
35
|
+
role_id: number;
|
|
36
|
+
|
|
37
|
+
@Column({ type: 'text', nullable: false })
|
|
38
|
+
message: string;
|
|
39
|
+
|
|
40
|
+
@Column({
|
|
41
|
+
type: 'enum',
|
|
42
|
+
enum: RetiredCardMessageType,
|
|
43
|
+
default: RetiredCardMessageType.TEXT,
|
|
44
|
+
nullable: false
|
|
45
|
+
})
|
|
46
|
+
messageType: RetiredCardMessageType;
|
|
47
|
+
|
|
48
|
+
@Column({ type: 'text', nullable: true })
|
|
49
|
+
status: string;
|
|
50
|
+
|
|
51
|
+
constructor(
|
|
52
|
+
request_id: number,
|
|
53
|
+
user_id: number,
|
|
54
|
+
role_id: number,
|
|
55
|
+
message: string,
|
|
56
|
+
service_id?: number,
|
|
57
|
+
sub_service_id?: number,
|
|
58
|
+
messageType?: RetiredCardMessageType,
|
|
59
|
+
status?: string
|
|
60
|
+
) {
|
|
61
|
+
super();
|
|
62
|
+
this.request_id = request_id;
|
|
63
|
+
this.service_id = service_id || null;
|
|
64
|
+
this.sub_service_id = sub_service_id || null;
|
|
65
|
+
this.user_id = user_id;
|
|
66
|
+
this.role_id = role_id;
|
|
67
|
+
this.message = message;
|
|
68
|
+
this.messageType = messageType || RetiredCardMessageType.TEXT;
|
|
69
|
+
this.status = status || 'Pending';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|