@platform-modules/civil-aviation-authority 2.3.189 → 2.3.193
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 +0 -8
- package/dist/models/ScholarshipAttendeeModel.d.ts +1 -0
- package/dist/models/ScholarshipAttendeeModel.js +4 -0
- package/dist/models/role.d.ts +2 -1
- package/dist/models/role.js +7 -2
- package/package.json +1 -1
- package/platform-modules-civil-aviation-authority-2.3.193.tgz +0 -0
- package/src/models/AccessCardRequestModel.ts +135 -135
- package/src/models/AirportEntryPermitModel.ts +276 -276
- package/src/models/AnnualTrainingPlanRequestModel.ts +153 -153
- package/src/models/DepartmentsModel.ts +25 -25
- package/src/models/DocumentDriveModel.ts +28 -28
- package/src/models/DocumentFolderModel.ts +45 -45
- package/src/models/HousingContractCancelChatModel.ts +56 -56
- package/src/models/HousingContractRenewalChatModel.ts +59 -59
- package/src/models/ITRequestAttachmentModel.ts +73 -73
- package/src/models/ITRequestChatModel.ts +74 -74
- package/src/models/ItApprovalsModel.ts +84 -84
- package/src/models/ItWorkflowModel.ts +55 -55
- package/src/models/MissionTravelPassportExpiryNotificationConfigModel.ts +36 -36
- package/src/models/ResidentialUnitRentalChatModel.ts +56 -56
- package/src/models/ResidentialUnitRentalRequestModel.ts +218 -218
- package/src/models/ScholarshipAttendeeModel.ts +3 -0
- package/src/models/ServicesNotificationConfigModel.ts +55 -55
- package/src/models/StudyLeaveRequestModel.ts +144 -144
- package/src/models/TrainingRequestModel.ts +164 -164
- package/src/models/TrainingRoomBookingRequestModel.ts +142 -142
- package/src/models/TrainingRoomNotificationConfigModel.ts +30 -30
- package/src/models/role.ts +7 -3
- package/src/models/user.ts +233 -233
- package/dist/models/DocumentMetadataModel.d.ts +0 -45
- package/dist/models/DocumentMetadataModel.js +0 -171
- package/dist/models/DocumentationDepartmentsModel.d.ts +0 -13
- package/dist/models/DocumentationDepartmentsModel.js +0 -53
- package/dist/models/FolderModel.d.ts +0 -16
- package/dist/models/FolderModel.js +0 -85
- package/dist/models/PermissionModel.d.ts +0 -18
- package/dist/models/PermissionModel.js +0 -68
- package/dist/models/UUIDBaseModel.d.ts +0 -14
- package/dist/models/UUIDBaseModel.js +0 -66
package/src/models/user.ts
CHANGED
|
@@ -1,234 +1,234 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
@Entity({ name: 'users' })
|
|
5
|
-
export class User extends BaseModel {
|
|
6
|
-
|
|
7
|
-
@Column({ type: 'bigint', nullable: true })
|
|
8
|
-
employee_id?: number;
|
|
9
|
-
|
|
10
|
-
@Column({ type: 'bigint', nullable: true })
|
|
11
|
-
civil_employee_id?: number;
|
|
12
|
-
|
|
13
|
-
@Column({ nullable: true })
|
|
14
|
-
employee_name?: string;
|
|
15
|
-
|
|
16
|
-
@Column({ nullable: true })
|
|
17
|
-
employee_arabic_name?: string;
|
|
18
|
-
|
|
19
|
-
@Column({ nullable: true })
|
|
20
|
-
person_type?: string;
|
|
21
|
-
|
|
22
|
-
@Column({ nullable: true })
|
|
23
|
-
date_of_birth?: string;
|
|
24
|
-
|
|
25
|
-
@Column({ nullable: true })
|
|
26
|
-
region_of_birth?: string;
|
|
27
|
-
|
|
28
|
-
@Column({ nullable: true })
|
|
29
|
-
country_of_birth?: string;
|
|
30
|
-
|
|
31
|
-
@Column({ nullable: true })
|
|
32
|
-
date_of_joining?: string;
|
|
33
|
-
|
|
34
|
-
@Column({ nullable: true })
|
|
35
|
-
last_promotion_date?: string;
|
|
36
|
-
|
|
37
|
-
@Column({ nullable: true })
|
|
38
|
-
gender?: string;
|
|
39
|
-
|
|
40
|
-
@Column({ nullable: true })
|
|
41
|
-
qualification?: string;
|
|
42
|
-
|
|
43
|
-
@Column({ nullable: true })
|
|
44
|
-
marital_status?: string;
|
|
45
|
-
|
|
46
|
-
@Column({ nullable: true })
|
|
47
|
-
nationality?: string;
|
|
48
|
-
|
|
49
|
-
@Column({ nullable: true })
|
|
50
|
-
email?: string;
|
|
51
|
-
|
|
52
|
-
@Column({ nullable: true })
|
|
53
|
-
blood_type?: string;
|
|
54
|
-
|
|
55
|
-
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
56
|
-
national_id?: string;
|
|
57
|
-
|
|
58
|
-
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
59
|
-
manpower_id?: string;
|
|
60
|
-
|
|
61
|
-
@Column({ nullable: true })
|
|
62
|
-
mobile?: string;
|
|
63
|
-
|
|
64
|
-
@Column({ nullable: true })
|
|
65
|
-
office_number?: string;
|
|
66
|
-
|
|
67
|
-
@Column({ nullable: true })
|
|
68
|
-
department?: number;
|
|
69
|
-
|
|
70
|
-
@Column({ type: "enum", enum: ["CAA", "Embassy"], nullable: false, default: "CAA" })
|
|
71
|
-
category: "CAA" | "Embassy"; // Mandatory
|
|
72
|
-
|
|
73
|
-
@Column({ nullable: true })
|
|
74
|
-
directorate?: string;
|
|
75
|
-
|
|
76
|
-
@Column({ nullable: true })
|
|
77
|
-
section?: number;
|
|
78
|
-
|
|
79
|
-
@Column({ nullable: true })
|
|
80
|
-
position?: number;
|
|
81
|
-
|
|
82
|
-
@Column({ nullable: true })
|
|
83
|
-
arabic_position?: string;
|
|
84
|
-
|
|
85
|
-
@Column({ nullable: true })
|
|
86
|
-
grade?: number;
|
|
87
|
-
|
|
88
|
-
@Column({ nullable: true })
|
|
89
|
-
location?: string;
|
|
90
|
-
|
|
91
|
-
@Column({ type: 'bigint', nullable: true })
|
|
92
|
-
supervisor_emp_id?: number;
|
|
93
|
-
|
|
94
|
-
@Column({ nullable: true })
|
|
95
|
-
supervisor_emp_name?: string;
|
|
96
|
-
|
|
97
|
-
@Column({ nullable: true , default: false})
|
|
98
|
-
is_admin?: boolean;
|
|
99
|
-
|
|
100
|
-
@Column({ nullable: true })
|
|
101
|
-
passport_number?: string;
|
|
102
|
-
|
|
103
|
-
@Column({ nullable: true })
|
|
104
|
-
personal_email?: string;
|
|
105
|
-
|
|
106
|
-
@Column({ nullable: true })
|
|
107
|
-
extension_number?: number;
|
|
108
|
-
|
|
109
|
-
@Column({ type: "varchar", length: 20, nullable: true })
|
|
110
|
-
fax_number?: string; // Optional
|
|
111
|
-
|
|
112
|
-
@Column({ nullable: true })
|
|
113
|
-
diplomatic_name?: string;
|
|
114
|
-
|
|
115
|
-
@Column({ nullable: true })
|
|
116
|
-
avatar?: string;
|
|
117
|
-
|
|
118
|
-
@Column({ nullable: true })
|
|
119
|
-
father_name?: string;
|
|
120
|
-
|
|
121
|
-
@Column({ nullable: true })
|
|
122
|
-
spouse_name?: string;
|
|
123
|
-
|
|
124
|
-
@Column({ nullable: true })
|
|
125
|
-
children1_name?: string;
|
|
126
|
-
|
|
127
|
-
@Column({ nullable: true })
|
|
128
|
-
children2_name?: string;
|
|
129
|
-
|
|
130
|
-
@Column({ nullable: true })
|
|
131
|
-
address?: string;
|
|
132
|
-
|
|
133
|
-
@Column({ nullable: true })
|
|
134
|
-
religion?: string;
|
|
135
|
-
|
|
136
|
-
@Column({ type: "decimal", precision: 10, scale: 3, nullable: true })
|
|
137
|
-
current_basic_salary: number;
|
|
138
|
-
|
|
139
|
-
@Column({ type: "decimal", precision: 10, scale: 3, nullable: true })
|
|
140
|
-
previous_basic_salary: number;
|
|
141
|
-
|
|
142
|
-
constructor(
|
|
143
|
-
employee_id?: number,
|
|
144
|
-
civil_employee_id?: number,
|
|
145
|
-
employee_name?: string,
|
|
146
|
-
employee_arabic_name?: string,
|
|
147
|
-
person_type?: string,
|
|
148
|
-
date_of_birth?: string,
|
|
149
|
-
region_of_birth?: string,
|
|
150
|
-
country_of_birth?: string,
|
|
151
|
-
date_of_joining?: string,
|
|
152
|
-
last_promotion_date?: string,
|
|
153
|
-
gender?: string,
|
|
154
|
-
qualification?: string,
|
|
155
|
-
marital_status?: string,
|
|
156
|
-
nationality?: string,
|
|
157
|
-
email?: string,
|
|
158
|
-
blood_type?: string,
|
|
159
|
-
national_id?: string,
|
|
160
|
-
manpower_id?: string,
|
|
161
|
-
mobile?: string,
|
|
162
|
-
office_number?: string,
|
|
163
|
-
department?: number,
|
|
164
|
-
category?: "CAA" | "Embassy",
|
|
165
|
-
directorate?: string,
|
|
166
|
-
section?: number,
|
|
167
|
-
position?: number,
|
|
168
|
-
arabic_position?: string,
|
|
169
|
-
grade?: number,
|
|
170
|
-
location?: string,
|
|
171
|
-
supervisor_emp_id?: number,
|
|
172
|
-
supervisor_emp_name?: string,
|
|
173
|
-
passport_number?: string,
|
|
174
|
-
personal_email?: string,
|
|
175
|
-
extension_number?: number,
|
|
176
|
-
fax_number?: string,
|
|
177
|
-
diplomatic_name?: string,
|
|
178
|
-
avatar?: string,
|
|
179
|
-
father_name?: string,
|
|
180
|
-
spouse_name?: string,
|
|
181
|
-
children1_name?: string,
|
|
182
|
-
children2_name?: string,
|
|
183
|
-
address?: string,
|
|
184
|
-
religion?: string,
|
|
185
|
-
current_basic_salary?: number,
|
|
186
|
-
previous_basic_salary?: number
|
|
187
|
-
) {
|
|
188
|
-
super();
|
|
189
|
-
this.employee_id = employee_id;
|
|
190
|
-
this.civil_employee_id = civil_employee_id;
|
|
191
|
-
this.employee_name = employee_name;
|
|
192
|
-
this.employee_arabic_name = employee_arabic_name;
|
|
193
|
-
this.person_type = person_type;
|
|
194
|
-
this.date_of_birth = date_of_birth;
|
|
195
|
-
this.region_of_birth = region_of_birth;
|
|
196
|
-
this.country_of_birth = country_of_birth;
|
|
197
|
-
this.date_of_joining = date_of_joining;
|
|
198
|
-
this.last_promotion_date = last_promotion_date;
|
|
199
|
-
this.gender = gender;
|
|
200
|
-
this.qualification = qualification;
|
|
201
|
-
this.marital_status = marital_status;
|
|
202
|
-
this.nationality = nationality;
|
|
203
|
-
this.email = email;
|
|
204
|
-
this.blood_type = blood_type;
|
|
205
|
-
this.national_id = national_id;
|
|
206
|
-
this.manpower_id = manpower_id;
|
|
207
|
-
this.mobile = mobile;
|
|
208
|
-
this.office_number = office_number;
|
|
209
|
-
this.department = department;
|
|
210
|
-
this.category = category || "CAA";
|
|
211
|
-
this.directorate = directorate;
|
|
212
|
-
this.section = section;
|
|
213
|
-
this.position = position;
|
|
214
|
-
this.arabic_position = arabic_position;
|
|
215
|
-
this.grade = grade;
|
|
216
|
-
this.location = location;
|
|
217
|
-
this.supervisor_emp_id = supervisor_emp_id;
|
|
218
|
-
this.supervisor_emp_name = supervisor_emp_name;
|
|
219
|
-
this.passport_number = passport_number;
|
|
220
|
-
this.personal_email = personal_email;
|
|
221
|
-
this.extension_number = extension_number;
|
|
222
|
-
this.fax_number = fax_number;
|
|
223
|
-
this.diplomatic_name = diplomatic_name;
|
|
224
|
-
this.avatar = avatar;
|
|
225
|
-
this.father_name = father_name;
|
|
226
|
-
this.spouse_name = spouse_name;
|
|
227
|
-
this.children1_name = children1_name;
|
|
228
|
-
this.children2_name = children2_name;
|
|
229
|
-
this.address = address;
|
|
230
|
-
this.religion = religion;
|
|
231
|
-
this.current_basic_salary = current_basic_salary || 0;
|
|
232
|
-
this.previous_basic_salary = previous_basic_salary || 0;
|
|
233
|
-
}
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'users' })
|
|
5
|
+
export class User extends BaseModel {
|
|
6
|
+
|
|
7
|
+
@Column({ type: 'bigint', nullable: true })
|
|
8
|
+
employee_id?: number;
|
|
9
|
+
|
|
10
|
+
@Column({ type: 'bigint', nullable: true })
|
|
11
|
+
civil_employee_id?: number;
|
|
12
|
+
|
|
13
|
+
@Column({ nullable: true })
|
|
14
|
+
employee_name?: string;
|
|
15
|
+
|
|
16
|
+
@Column({ nullable: true })
|
|
17
|
+
employee_arabic_name?: string;
|
|
18
|
+
|
|
19
|
+
@Column({ nullable: true })
|
|
20
|
+
person_type?: string;
|
|
21
|
+
|
|
22
|
+
@Column({ nullable: true })
|
|
23
|
+
date_of_birth?: string;
|
|
24
|
+
|
|
25
|
+
@Column({ nullable: true })
|
|
26
|
+
region_of_birth?: string;
|
|
27
|
+
|
|
28
|
+
@Column({ nullable: true })
|
|
29
|
+
country_of_birth?: string;
|
|
30
|
+
|
|
31
|
+
@Column({ nullable: true })
|
|
32
|
+
date_of_joining?: string;
|
|
33
|
+
|
|
34
|
+
@Column({ nullable: true })
|
|
35
|
+
last_promotion_date?: string;
|
|
36
|
+
|
|
37
|
+
@Column({ nullable: true })
|
|
38
|
+
gender?: string;
|
|
39
|
+
|
|
40
|
+
@Column({ nullable: true })
|
|
41
|
+
qualification?: string;
|
|
42
|
+
|
|
43
|
+
@Column({ nullable: true })
|
|
44
|
+
marital_status?: string;
|
|
45
|
+
|
|
46
|
+
@Column({ nullable: true })
|
|
47
|
+
nationality?: string;
|
|
48
|
+
|
|
49
|
+
@Column({ nullable: true })
|
|
50
|
+
email?: string;
|
|
51
|
+
|
|
52
|
+
@Column({ nullable: true })
|
|
53
|
+
blood_type?: string;
|
|
54
|
+
|
|
55
|
+
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
56
|
+
national_id?: string;
|
|
57
|
+
|
|
58
|
+
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
59
|
+
manpower_id?: string;
|
|
60
|
+
|
|
61
|
+
@Column({ nullable: true })
|
|
62
|
+
mobile?: string;
|
|
63
|
+
|
|
64
|
+
@Column({ nullable: true })
|
|
65
|
+
office_number?: string;
|
|
66
|
+
|
|
67
|
+
@Column({ nullable: true })
|
|
68
|
+
department?: number;
|
|
69
|
+
|
|
70
|
+
@Column({ type: "enum", enum: ["CAA", "Embassy"], nullable: false, default: "CAA" })
|
|
71
|
+
category: "CAA" | "Embassy"; // Mandatory
|
|
72
|
+
|
|
73
|
+
@Column({ nullable: true })
|
|
74
|
+
directorate?: string;
|
|
75
|
+
|
|
76
|
+
@Column({ nullable: true })
|
|
77
|
+
section?: number;
|
|
78
|
+
|
|
79
|
+
@Column({ nullable: true })
|
|
80
|
+
position?: number;
|
|
81
|
+
|
|
82
|
+
@Column({ nullable: true })
|
|
83
|
+
arabic_position?: string;
|
|
84
|
+
|
|
85
|
+
@Column({ nullable: true })
|
|
86
|
+
grade?: number;
|
|
87
|
+
|
|
88
|
+
@Column({ nullable: true })
|
|
89
|
+
location?: string;
|
|
90
|
+
|
|
91
|
+
@Column({ type: 'bigint', nullable: true })
|
|
92
|
+
supervisor_emp_id?: number;
|
|
93
|
+
|
|
94
|
+
@Column({ nullable: true })
|
|
95
|
+
supervisor_emp_name?: string;
|
|
96
|
+
|
|
97
|
+
@Column({ nullable: true , default: false})
|
|
98
|
+
is_admin?: boolean;
|
|
99
|
+
|
|
100
|
+
@Column({ nullable: true })
|
|
101
|
+
passport_number?: string;
|
|
102
|
+
|
|
103
|
+
@Column({ nullable: true })
|
|
104
|
+
personal_email?: string;
|
|
105
|
+
|
|
106
|
+
@Column({ nullable: true })
|
|
107
|
+
extension_number?: number;
|
|
108
|
+
|
|
109
|
+
@Column({ type: "varchar", length: 20, nullable: true })
|
|
110
|
+
fax_number?: string; // Optional
|
|
111
|
+
|
|
112
|
+
@Column({ nullable: true })
|
|
113
|
+
diplomatic_name?: string;
|
|
114
|
+
|
|
115
|
+
@Column({ nullable: true })
|
|
116
|
+
avatar?: string;
|
|
117
|
+
|
|
118
|
+
@Column({ nullable: true })
|
|
119
|
+
father_name?: string;
|
|
120
|
+
|
|
121
|
+
@Column({ nullable: true })
|
|
122
|
+
spouse_name?: string;
|
|
123
|
+
|
|
124
|
+
@Column({ nullable: true })
|
|
125
|
+
children1_name?: string;
|
|
126
|
+
|
|
127
|
+
@Column({ nullable: true })
|
|
128
|
+
children2_name?: string;
|
|
129
|
+
|
|
130
|
+
@Column({ nullable: true })
|
|
131
|
+
address?: string;
|
|
132
|
+
|
|
133
|
+
@Column({ nullable: true })
|
|
134
|
+
religion?: string;
|
|
135
|
+
|
|
136
|
+
@Column({ type: "decimal", precision: 10, scale: 3, nullable: true })
|
|
137
|
+
current_basic_salary: number;
|
|
138
|
+
|
|
139
|
+
@Column({ type: "decimal", precision: 10, scale: 3, nullable: true })
|
|
140
|
+
previous_basic_salary: number;
|
|
141
|
+
|
|
142
|
+
constructor(
|
|
143
|
+
employee_id?: number,
|
|
144
|
+
civil_employee_id?: number,
|
|
145
|
+
employee_name?: string,
|
|
146
|
+
employee_arabic_name?: string,
|
|
147
|
+
person_type?: string,
|
|
148
|
+
date_of_birth?: string,
|
|
149
|
+
region_of_birth?: string,
|
|
150
|
+
country_of_birth?: string,
|
|
151
|
+
date_of_joining?: string,
|
|
152
|
+
last_promotion_date?: string,
|
|
153
|
+
gender?: string,
|
|
154
|
+
qualification?: string,
|
|
155
|
+
marital_status?: string,
|
|
156
|
+
nationality?: string,
|
|
157
|
+
email?: string,
|
|
158
|
+
blood_type?: string,
|
|
159
|
+
national_id?: string,
|
|
160
|
+
manpower_id?: string,
|
|
161
|
+
mobile?: string,
|
|
162
|
+
office_number?: string,
|
|
163
|
+
department?: number,
|
|
164
|
+
category?: "CAA" | "Embassy",
|
|
165
|
+
directorate?: string,
|
|
166
|
+
section?: number,
|
|
167
|
+
position?: number,
|
|
168
|
+
arabic_position?: string,
|
|
169
|
+
grade?: number,
|
|
170
|
+
location?: string,
|
|
171
|
+
supervisor_emp_id?: number,
|
|
172
|
+
supervisor_emp_name?: string,
|
|
173
|
+
passport_number?: string,
|
|
174
|
+
personal_email?: string,
|
|
175
|
+
extension_number?: number,
|
|
176
|
+
fax_number?: string,
|
|
177
|
+
diplomatic_name?: string,
|
|
178
|
+
avatar?: string,
|
|
179
|
+
father_name?: string,
|
|
180
|
+
spouse_name?: string,
|
|
181
|
+
children1_name?: string,
|
|
182
|
+
children2_name?: string,
|
|
183
|
+
address?: string,
|
|
184
|
+
religion?: string,
|
|
185
|
+
current_basic_salary?: number,
|
|
186
|
+
previous_basic_salary?: number
|
|
187
|
+
) {
|
|
188
|
+
super();
|
|
189
|
+
this.employee_id = employee_id;
|
|
190
|
+
this.civil_employee_id = civil_employee_id;
|
|
191
|
+
this.employee_name = employee_name;
|
|
192
|
+
this.employee_arabic_name = employee_arabic_name;
|
|
193
|
+
this.person_type = person_type;
|
|
194
|
+
this.date_of_birth = date_of_birth;
|
|
195
|
+
this.region_of_birth = region_of_birth;
|
|
196
|
+
this.country_of_birth = country_of_birth;
|
|
197
|
+
this.date_of_joining = date_of_joining;
|
|
198
|
+
this.last_promotion_date = last_promotion_date;
|
|
199
|
+
this.gender = gender;
|
|
200
|
+
this.qualification = qualification;
|
|
201
|
+
this.marital_status = marital_status;
|
|
202
|
+
this.nationality = nationality;
|
|
203
|
+
this.email = email;
|
|
204
|
+
this.blood_type = blood_type;
|
|
205
|
+
this.national_id = national_id;
|
|
206
|
+
this.manpower_id = manpower_id;
|
|
207
|
+
this.mobile = mobile;
|
|
208
|
+
this.office_number = office_number;
|
|
209
|
+
this.department = department;
|
|
210
|
+
this.category = category || "CAA";
|
|
211
|
+
this.directorate = directorate;
|
|
212
|
+
this.section = section;
|
|
213
|
+
this.position = position;
|
|
214
|
+
this.arabic_position = arabic_position;
|
|
215
|
+
this.grade = grade;
|
|
216
|
+
this.location = location;
|
|
217
|
+
this.supervisor_emp_id = supervisor_emp_id;
|
|
218
|
+
this.supervisor_emp_name = supervisor_emp_name;
|
|
219
|
+
this.passport_number = passport_number;
|
|
220
|
+
this.personal_email = personal_email;
|
|
221
|
+
this.extension_number = extension_number;
|
|
222
|
+
this.fax_number = fax_number;
|
|
223
|
+
this.diplomatic_name = diplomatic_name;
|
|
224
|
+
this.avatar = avatar;
|
|
225
|
+
this.father_name = father_name;
|
|
226
|
+
this.spouse_name = spouse_name;
|
|
227
|
+
this.children1_name = children1_name;
|
|
228
|
+
this.children2_name = children2_name;
|
|
229
|
+
this.address = address;
|
|
230
|
+
this.religion = religion;
|
|
231
|
+
this.current_basic_salary = current_basic_salary || 0;
|
|
232
|
+
this.previous_basic_salary = previous_basic_salary || 0;
|
|
233
|
+
}
|
|
234
234
|
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Departments } from './DepartmentsModel';
|
|
2
|
-
import { UUIDBaseModel } from './UUIDBaseModel';
|
|
3
|
-
export declare enum DocumentType {
|
|
4
|
-
POLICY = "policy",
|
|
5
|
-
PROCEDURE = "procedure",
|
|
6
|
-
MANUAL = "manual",
|
|
7
|
-
TEMPLATE = "template",
|
|
8
|
-
REPORT = "report"
|
|
9
|
-
}
|
|
10
|
-
export declare enum DocumentStatus {
|
|
11
|
-
ACTIVE = "active",
|
|
12
|
-
ARCHIVED = "archived",
|
|
13
|
-
DRAFT = "draft"
|
|
14
|
-
}
|
|
15
|
-
export declare enum AccessLevel {
|
|
16
|
-
GENERAL = "general",
|
|
17
|
-
RESTRICTED = "restricted"
|
|
18
|
-
}
|
|
19
|
-
export declare class DocumentMetadata extends UUIDBaseModel {
|
|
20
|
-
title: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
original_name: string;
|
|
23
|
-
mime_type: string;
|
|
24
|
-
size: number;
|
|
25
|
-
mongodb_file_id: string;
|
|
26
|
-
document_type: DocumentType;
|
|
27
|
-
access_level: AccessLevel;
|
|
28
|
-
status: DocumentStatus;
|
|
29
|
-
version: string;
|
|
30
|
-
tags: string[];
|
|
31
|
-
is_sensitive: boolean;
|
|
32
|
-
department: Departments;
|
|
33
|
-
department_id: number;
|
|
34
|
-
folder_id?: string | null;
|
|
35
|
-
folder_path: string;
|
|
36
|
-
uploaded_by: string;
|
|
37
|
-
uploaded_by_name?: string;
|
|
38
|
-
authorized_person?: string;
|
|
39
|
-
allowed_roles: string[];
|
|
40
|
-
allowed_users: string[];
|
|
41
|
-
download_count: number;
|
|
42
|
-
last_accessed_at?: Date;
|
|
43
|
-
metadata?: Record<string, any>;
|
|
44
|
-
constructor(title: string, original_name: string, mime_type: string, size: number, mongodb_file_id: string, document_type: DocumentType, department_id: number, uploaded_by: string, access_level?: AccessLevel, status?: DocumentStatus, version?: string, folder_path?: string, created_by?: string, description?: string, folder_id?: string | null, uploaded_by_name?: string, authorized_person?: string, tags?: string[], allowed_roles?: string[], allowed_users?: string[], is_sensitive?: boolean, download_count?: number, last_accessed_at?: Date, metadata?: Record<string, any>);
|
|
45
|
-
}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.DocumentMetadata = exports.AccessLevel = exports.DocumentStatus = exports.DocumentType = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const DepartmentsModel_1 = require("./DepartmentsModel");
|
|
15
|
-
const UUIDBaseModel_1 = require("./UUIDBaseModel");
|
|
16
|
-
var DocumentType;
|
|
17
|
-
(function (DocumentType) {
|
|
18
|
-
DocumentType["POLICY"] = "policy";
|
|
19
|
-
DocumentType["PROCEDURE"] = "procedure";
|
|
20
|
-
DocumentType["MANUAL"] = "manual";
|
|
21
|
-
DocumentType["TEMPLATE"] = "template";
|
|
22
|
-
DocumentType["REPORT"] = "report";
|
|
23
|
-
})(DocumentType || (exports.DocumentType = DocumentType = {}));
|
|
24
|
-
var DocumentStatus;
|
|
25
|
-
(function (DocumentStatus) {
|
|
26
|
-
DocumentStatus["ACTIVE"] = "active";
|
|
27
|
-
DocumentStatus["ARCHIVED"] = "archived";
|
|
28
|
-
DocumentStatus["DRAFT"] = "draft";
|
|
29
|
-
})(DocumentStatus || (exports.DocumentStatus = DocumentStatus = {}));
|
|
30
|
-
var AccessLevel;
|
|
31
|
-
(function (AccessLevel) {
|
|
32
|
-
AccessLevel["GENERAL"] = "general";
|
|
33
|
-
AccessLevel["RESTRICTED"] = "restricted";
|
|
34
|
-
})(AccessLevel || (exports.AccessLevel = AccessLevel = {}));
|
|
35
|
-
let DocumentMetadata = class DocumentMetadata extends UUIDBaseModel_1.UUIDBaseModel {
|
|
36
|
-
constructor(title, original_name, mime_type, size, mongodb_file_id, document_type, department_id, uploaded_by, access_level = AccessLevel.GENERAL, status = DocumentStatus.ACTIVE, version = '1.0.0', folder_path = '/', created_by, description, folder_id, uploaded_by_name, authorized_person, tags, allowed_roles, allowed_users, is_sensitive = false, download_count = 0, last_accessed_at, metadata) {
|
|
37
|
-
super();
|
|
38
|
-
this.title = title;
|
|
39
|
-
this.original_name = original_name;
|
|
40
|
-
this.mime_type = mime_type;
|
|
41
|
-
this.size = size;
|
|
42
|
-
this.mongodb_file_id = mongodb_file_id;
|
|
43
|
-
this.document_type = document_type;
|
|
44
|
-
this.department_id = department_id;
|
|
45
|
-
this.uploaded_by = uploaded_by;
|
|
46
|
-
this.access_level = access_level;
|
|
47
|
-
this.status = status;
|
|
48
|
-
this.version = version;
|
|
49
|
-
this.folder_path = folder_path;
|
|
50
|
-
this.description = description;
|
|
51
|
-
this.folder_id = folder_id;
|
|
52
|
-
this.uploaded_by_name = uploaded_by_name;
|
|
53
|
-
this.authorized_person = authorized_person;
|
|
54
|
-
this.tags = tags || [];
|
|
55
|
-
this.allowed_roles = allowed_roles || [];
|
|
56
|
-
this.allowed_users = allowed_users || [];
|
|
57
|
-
this.is_sensitive = is_sensitive;
|
|
58
|
-
this.download_count = download_count;
|
|
59
|
-
this.last_accessed_at = last_accessed_at;
|
|
60
|
-
this.metadata = metadata;
|
|
61
|
-
if (created_by) {
|
|
62
|
-
this.created_by = created_by;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
exports.DocumentMetadata = DocumentMetadata;
|
|
67
|
-
__decorate([
|
|
68
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 500 }),
|
|
69
|
-
(0, typeorm_1.Index)(),
|
|
70
|
-
__metadata("design:type", String)
|
|
71
|
-
], DocumentMetadata.prototype, "title", void 0);
|
|
72
|
-
__decorate([
|
|
73
|
-
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
74
|
-
__metadata("design:type", String)
|
|
75
|
-
], DocumentMetadata.prototype, "description", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
|
|
78
|
-
__metadata("design:type", String)
|
|
79
|
-
], DocumentMetadata.prototype, "original_name", void 0);
|
|
80
|
-
__decorate([
|
|
81
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 100 }),
|
|
82
|
-
__metadata("design:type", String)
|
|
83
|
-
], DocumentMetadata.prototype, "mime_type", void 0);
|
|
84
|
-
__decorate([
|
|
85
|
-
(0, typeorm_1.Column)({ type: 'bigint' }),
|
|
86
|
-
__metadata("design:type", Number)
|
|
87
|
-
], DocumentMetadata.prototype, "size", void 0);
|
|
88
|
-
__decorate([
|
|
89
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 255, unique: true }),
|
|
90
|
-
__metadata("design:type", String)
|
|
91
|
-
], DocumentMetadata.prototype, "mongodb_file_id", void 0);
|
|
92
|
-
__decorate([
|
|
93
|
-
(0, typeorm_1.Column)({ type: 'enum', enum: DocumentType }),
|
|
94
|
-
(0, typeorm_1.Index)(),
|
|
95
|
-
__metadata("design:type", String)
|
|
96
|
-
], DocumentMetadata.prototype, "document_type", void 0);
|
|
97
|
-
__decorate([
|
|
98
|
-
(0, typeorm_1.Column)({ type: 'enum', enum: AccessLevel, default: AccessLevel.GENERAL }),
|
|
99
|
-
(0, typeorm_1.Index)(),
|
|
100
|
-
__metadata("design:type", String)
|
|
101
|
-
], DocumentMetadata.prototype, "access_level", void 0);
|
|
102
|
-
__decorate([
|
|
103
|
-
(0, typeorm_1.Column)({ type: 'enum', enum: DocumentStatus, default: DocumentStatus.ACTIVE }),
|
|
104
|
-
(0, typeorm_1.Index)(),
|
|
105
|
-
__metadata("design:type", String)
|
|
106
|
-
], DocumentMetadata.prototype, "status", void 0);
|
|
107
|
-
__decorate([
|
|
108
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 50, default: '1.0.0' }),
|
|
109
|
-
__metadata("design:type", String)
|
|
110
|
-
], DocumentMetadata.prototype, "version", void 0);
|
|
111
|
-
__decorate([
|
|
112
|
-
(0, typeorm_1.Column)({ type: 'text', array: true, default: [] }),
|
|
113
|
-
__metadata("design:type", Array)
|
|
114
|
-
], DocumentMetadata.prototype, "tags", void 0);
|
|
115
|
-
__decorate([
|
|
116
|
-
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
117
|
-
__metadata("design:type", Boolean)
|
|
118
|
-
], DocumentMetadata.prototype, "is_sensitive", void 0);
|
|
119
|
-
__decorate([
|
|
120
|
-
(0, typeorm_1.ManyToOne)('Departments', { eager: true }),
|
|
121
|
-
(0, typeorm_1.JoinColumn)({ name: 'department_id' }),
|
|
122
|
-
__metadata("design:type", DepartmentsModel_1.Departments)
|
|
123
|
-
], DocumentMetadata.prototype, "department", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
126
|
-
__metadata("design:type", Number)
|
|
127
|
-
], DocumentMetadata.prototype, "department_id", void 0);
|
|
128
|
-
__decorate([
|
|
129
|
-
(0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
|
|
130
|
-
__metadata("design:type", Object)
|
|
131
|
-
], DocumentMetadata.prototype, "folder_id", void 0);
|
|
132
|
-
__decorate([
|
|
133
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 500, default: '/' }),
|
|
134
|
-
__metadata("design:type", String)
|
|
135
|
-
], DocumentMetadata.prototype, "folder_path", void 0);
|
|
136
|
-
__decorate([
|
|
137
|
-
(0, typeorm_1.Column)({ type: 'uuid' }),
|
|
138
|
-
__metadata("design:type", String)
|
|
139
|
-
], DocumentMetadata.prototype, "uploaded_by", void 0);
|
|
140
|
-
__decorate([
|
|
141
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
142
|
-
__metadata("design:type", String)
|
|
143
|
-
], DocumentMetadata.prototype, "uploaded_by_name", void 0);
|
|
144
|
-
__decorate([
|
|
145
|
-
(0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
|
|
146
|
-
__metadata("design:type", String)
|
|
147
|
-
], DocumentMetadata.prototype, "authorized_person", void 0);
|
|
148
|
-
__decorate([
|
|
149
|
-
(0, typeorm_1.Column)({ type: 'text', array: true, default: [] }),
|
|
150
|
-
__metadata("design:type", Array)
|
|
151
|
-
], DocumentMetadata.prototype, "allowed_roles", void 0);
|
|
152
|
-
__decorate([
|
|
153
|
-
(0, typeorm_1.Column)({ type: 'text', array: true, default: [] }),
|
|
154
|
-
__metadata("design:type", Array)
|
|
155
|
-
], DocumentMetadata.prototype, "allowed_users", void 0);
|
|
156
|
-
__decorate([
|
|
157
|
-
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
158
|
-
__metadata("design:type", Number)
|
|
159
|
-
], DocumentMetadata.prototype, "download_count", void 0);
|
|
160
|
-
__decorate([
|
|
161
|
-
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
|
|
162
|
-
__metadata("design:type", Date)
|
|
163
|
-
], DocumentMetadata.prototype, "last_accessed_at", void 0);
|
|
164
|
-
__decorate([
|
|
165
|
-
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
166
|
-
__metadata("design:type", Object)
|
|
167
|
-
], DocumentMetadata.prototype, "metadata", void 0);
|
|
168
|
-
exports.DocumentMetadata = DocumentMetadata = __decorate([
|
|
169
|
-
(0, typeorm_1.Entity)({ name: 'document_metadata' }),
|
|
170
|
-
__metadata("design:paramtypes", [String, String, String, Number, String, String, Number, String, String, String, String, String, String, String, Object, String, String, Array, Array, Array, Boolean, Number, Date, Object])
|
|
171
|
-
], DocumentMetadata);
|