@platform-modules/civil-aviation-authority 2.3.150 → 2.3.155
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 +8 -0
- package/dist/data-source.js +10 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +20 -3
- package/dist/models/DocumentMetadataModel.d.ts +45 -0
- package/dist/models/DocumentMetadataModel.js +171 -0
- package/dist/models/DocumentationDepartmentsModel.d.ts +13 -0
- package/dist/models/DocumentationDepartmentsModel.js +53 -0
- package/dist/models/EventSupportApprovalModel.d.ts +23 -0
- package/dist/models/EventSupportApprovalModel.js +88 -0
- package/dist/models/EventSupportAttachmentModel.d.ts +12 -0
- package/dist/models/EventSupportAttachmentModel.js +56 -0
- package/dist/models/EventSupportChatModel.d.ts +18 -0
- package/dist/models/EventSupportChatModel.js +65 -0
- package/dist/models/EventSupportRequestModel.d.ts +27 -0
- package/dist/models/EventSupportRequestModel.js +89 -0
- package/dist/models/EventSupportWorkflowModel.d.ts +18 -0
- package/dist/models/EventSupportWorkflowModel.js +66 -0
- package/dist/models/FolderModel.d.ts +16 -0
- package/dist/models/FolderModel.js +85 -0
- package/dist/models/LegalComplaintRequestModel.d.ts +101 -6
- package/dist/models/LegalComplaintRequestModel.js +257 -5
- package/dist/models/PermissionModel.d.ts +18 -0
- package/dist/models/PermissionModel.js +68 -0
- package/dist/models/UUIDBaseModel.d.ts +14 -0
- package/dist/models/UUIDBaseModel.js +66 -0
- package/package.json +1 -1
- package/src/data-source.ts +10 -0
- package/src/index.ts +11 -0
- 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/EventSupportApprovalModel.ts +59 -0
- package/src/models/EventSupportAttachmentModel.ts +32 -0
- package/src/models/EventSupportChatModel.ts +42 -0
- package/src/models/EventSupportRequestModel.ts +60 -0
- package/src/models/EventSupportWorkflowModel.ts +41 -0
- package/src/models/HousingContractCancelChatModel.ts +56 -56
- package/src/models/HousingContractRenewalChatModel.ts +59 -59
- package/src/models/ITRequestChatModel.ts +62 -62
- package/src/models/ItApprovalsModel.ts +84 -84
- package/src/models/ItWorkflowModel.ts +55 -55
- package/src/models/LegalComplaintRequestModel.ts +322 -8
- package/src/models/MissionTravelPassportExpiryNotificationConfigModel.ts +36 -36
- package/src/models/ResidentialUnitRentalChatModel.ts +56 -56
- package/src/models/ResidentialUnitRentalRequestModel.ts +218 -218
- package/src/models/ServicesNotificationConfigModel.ts +55 -55
- package/src/models/StudyLeaveRequestModel.ts +144 -144
- package/src/models/TrainingRoomBookingRequestModel.ts +142 -142
- package/src/models/TrainingRoomNotificationConfigModel.ts +30 -30
|
@@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.LegalComplaintRequest = exports.LegalComplaintRequestStatus = void 0;
|
|
13
|
+
exports.parseLegalComplaintCreateFields = parseLegalComplaintCreateFields;
|
|
13
14
|
const typeorm_1 = require("typeorm");
|
|
14
15
|
const BaseModel_1 = require("./BaseModel");
|
|
15
16
|
var LegalComplaintRequestStatus;
|
|
@@ -19,6 +20,177 @@ var LegalComplaintRequestStatus;
|
|
|
19
20
|
LegalComplaintRequestStatus["Rejected"] = "Rejected";
|
|
20
21
|
LegalComplaintRequestStatus["RFC"] = "RFC";
|
|
21
22
|
})(LegalComplaintRequestStatus || (exports.LegalComplaintRequestStatus = LegalComplaintRequestStatus = {}));
|
|
23
|
+
function pickStr(v) {
|
|
24
|
+
if (v == null || v === '')
|
|
25
|
+
return null;
|
|
26
|
+
const s = String(v).trim();
|
|
27
|
+
return s === '' ? null : s;
|
|
28
|
+
}
|
|
29
|
+
function pickNum(v) {
|
|
30
|
+
if (v == null || v === '')
|
|
31
|
+
return null;
|
|
32
|
+
const n = Number(v);
|
|
33
|
+
return Number.isFinite(n) && n > 0 ? Math.floor(n) : null;
|
|
34
|
+
}
|
|
35
|
+
/** YYYY-MM-DD or parseable date string; returns null if invalid. */
|
|
36
|
+
function pickDateOnlyStr(v) {
|
|
37
|
+
if (v == null || v === '')
|
|
38
|
+
return null;
|
|
39
|
+
const s = String(v).trim();
|
|
40
|
+
const iso = s.match(/^(\d{4}-\d{2}-\d{2})/);
|
|
41
|
+
if (iso)
|
|
42
|
+
return iso[1];
|
|
43
|
+
const d = new Date(s);
|
|
44
|
+
if (Number.isNaN(d.getTime()))
|
|
45
|
+
return null;
|
|
46
|
+
return d.toISOString().slice(0, 10);
|
|
47
|
+
}
|
|
48
|
+
function pickDepartmentSectionNames(obj, idKey, altIdKey, nameKey, plainKey) {
|
|
49
|
+
let id = pickNum(obj[idKey] ?? obj[altIdKey]);
|
|
50
|
+
let name = pickStr(obj[nameKey]);
|
|
51
|
+
const plain = obj[plainKey];
|
|
52
|
+
if (plain != null && plain !== '') {
|
|
53
|
+
if (typeof plain === 'number' || (typeof plain === 'string' && /^\d+$/.test(String(plain).trim()))) {
|
|
54
|
+
const n = pickNum(plain);
|
|
55
|
+
if (n != null && id == null)
|
|
56
|
+
id = n;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const ps = pickStr(plain);
|
|
60
|
+
if (ps)
|
|
61
|
+
name = name || ps;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return { id, name };
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Maps API / Conductor `requestData` to DB columns.
|
|
68
|
+
* Preferred: `complaint_incident`, `complainant`, `complained_employee` objects.
|
|
69
|
+
* Legacy: `complaint_details`, `complainant_details`, `complained_employee_details` non-empty strings.
|
|
70
|
+
*/
|
|
71
|
+
function parseLegalComplaintCreateFields(body) {
|
|
72
|
+
const legacyComplaint = body.complaint_details;
|
|
73
|
+
const legacyComplainant = body.complainant_details;
|
|
74
|
+
const legacySubject = body.complained_employee_details;
|
|
75
|
+
const inc = body.complaint_incident ?? body.complaintIncident;
|
|
76
|
+
let incident_time = null;
|
|
77
|
+
let incident_date = null;
|
|
78
|
+
let incident_location = null;
|
|
79
|
+
let individuals_involved = null;
|
|
80
|
+
let incident_events = null;
|
|
81
|
+
let incident_other_details = null;
|
|
82
|
+
let incident_description = '';
|
|
83
|
+
if (typeof legacyComplaint === 'string' && legacyComplaint.trim() !== '' && (inc == null || typeof inc !== 'object')) {
|
|
84
|
+
incident_description = legacyComplaint.trim();
|
|
85
|
+
}
|
|
86
|
+
else if (inc != null && typeof inc === 'object' && !Array.isArray(inc)) {
|
|
87
|
+
incident_time = pickStr(inc.incident_time ?? inc.time);
|
|
88
|
+
incident_date = pickDateOnlyStr(inc.incident_date ?? inc.date_of_incident);
|
|
89
|
+
incident_location = pickStr(inc.incident_location ?? inc.location);
|
|
90
|
+
individuals_involved = pickStr(inc.individuals_involved ?? inc.persons_involved);
|
|
91
|
+
incident_events = pickStr(inc.incident_events ?? inc.events);
|
|
92
|
+
incident_other_details = pickStr(inc.incident_other_details ?? inc.other_details ?? inc.any_other_details_related_to_complaint);
|
|
93
|
+
incident_description = String(inc.incident_description ?? inc.description ?? '').trim();
|
|
94
|
+
if (!incident_description) {
|
|
95
|
+
const parts = [incident_events, incident_other_details].filter((x) => x && String(x).trim());
|
|
96
|
+
incident_description = parts.join('\n\n').trim();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (!incident_description) {
|
|
100
|
+
return {
|
|
101
|
+
ok: false,
|
|
102
|
+
message: 'complaint_incident must include incident_description, or incident_events / incident_other_details, or legacy complaint_details text',
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const comp = body.complainant;
|
|
106
|
+
let complainant_name = '';
|
|
107
|
+
let complainant_position = null;
|
|
108
|
+
let complainant_employee_id = null;
|
|
109
|
+
let complainant_directorate = null;
|
|
110
|
+
let complainant_department_id = null;
|
|
111
|
+
let complainant_department_name = null;
|
|
112
|
+
let complainant_section_id = null;
|
|
113
|
+
let complainant_section_name = null;
|
|
114
|
+
if (typeof legacyComplainant === 'string' && legacyComplainant.trim() !== '' && (comp == null || typeof comp !== 'object')) {
|
|
115
|
+
complainant_name = legacyComplainant.trim();
|
|
116
|
+
}
|
|
117
|
+
else if (comp != null && typeof comp === 'object' && !Array.isArray(comp)) {
|
|
118
|
+
complainant_name = String(comp.name ?? '').trim();
|
|
119
|
+
complainant_position = pickStr(comp.position);
|
|
120
|
+
complainant_employee_id = pickStr(comp.employee_id ?? comp.employeeId);
|
|
121
|
+
complainant_directorate = pickStr(comp.directorate);
|
|
122
|
+
const dep = pickDepartmentSectionNames(comp, 'department_id', 'departmentId', 'department_name', 'department');
|
|
123
|
+
const sec = pickDepartmentSectionNames(comp, 'section_id', 'sectionId', 'section_name', 'section');
|
|
124
|
+
complainant_department_id = dep.id;
|
|
125
|
+
complainant_department_name = dep.name;
|
|
126
|
+
complainant_section_id = sec.id;
|
|
127
|
+
complainant_section_name = sec.name;
|
|
128
|
+
}
|
|
129
|
+
if (!complainant_name) {
|
|
130
|
+
return {
|
|
131
|
+
ok: false,
|
|
132
|
+
message: 'complainant.name is required (or legacy complainant_details text)',
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const sub = body.complained_employee ?? body.complainedEmployee;
|
|
136
|
+
let complained_employee_name = '';
|
|
137
|
+
let complained_employee_position = null;
|
|
138
|
+
let complained_employee_salary_grade = null;
|
|
139
|
+
let complained_employee_directorate = null;
|
|
140
|
+
let complained_employee_department_id = null;
|
|
141
|
+
let complained_employee_department_name = null;
|
|
142
|
+
let complained_employee_section_id = null;
|
|
143
|
+
let complained_employee_section_name = null;
|
|
144
|
+
if (typeof legacySubject === 'string' && legacySubject.trim() !== '' && (sub == null || typeof sub !== 'object')) {
|
|
145
|
+
complained_employee_name = legacySubject.trim();
|
|
146
|
+
}
|
|
147
|
+
else if (sub != null && typeof sub === 'object' && !Array.isArray(sub)) {
|
|
148
|
+
complained_employee_name = String(sub.name ?? '').trim();
|
|
149
|
+
complained_employee_position = pickStr(sub.position);
|
|
150
|
+
complained_employee_salary_grade = pickStr(sub.salary_grade ?? sub.salaryGrade);
|
|
151
|
+
complained_employee_directorate = pickStr(sub.directorate);
|
|
152
|
+
const dep = pickDepartmentSectionNames(sub, 'department_id', 'departmentId', 'department_name', 'department');
|
|
153
|
+
const sec = pickDepartmentSectionNames(sub, 'section_id', 'sectionId', 'section_name', 'section');
|
|
154
|
+
complained_employee_department_id = dep.id;
|
|
155
|
+
complained_employee_department_name = dep.name;
|
|
156
|
+
complained_employee_section_id = sec.id;
|
|
157
|
+
complained_employee_section_name = sec.name;
|
|
158
|
+
}
|
|
159
|
+
if (!complained_employee_name) {
|
|
160
|
+
return {
|
|
161
|
+
ok: false,
|
|
162
|
+
message: 'complained_employee.name is required (or legacy complained_employee_details text)',
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
ok: true,
|
|
167
|
+
fields: {
|
|
168
|
+
incident_time,
|
|
169
|
+
incident_date,
|
|
170
|
+
incident_location,
|
|
171
|
+
individuals_involved,
|
|
172
|
+
incident_events,
|
|
173
|
+
incident_other_details,
|
|
174
|
+
incident_description,
|
|
175
|
+
complainant_name,
|
|
176
|
+
complainant_position,
|
|
177
|
+
complainant_employee_id,
|
|
178
|
+
complainant_directorate,
|
|
179
|
+
complainant_department_id,
|
|
180
|
+
complainant_department_name,
|
|
181
|
+
complainant_section_id,
|
|
182
|
+
complainant_section_name,
|
|
183
|
+
complained_employee_name,
|
|
184
|
+
complained_employee_position,
|
|
185
|
+
complained_employee_salary_grade,
|
|
186
|
+
complained_employee_directorate,
|
|
187
|
+
complained_employee_department_id,
|
|
188
|
+
complained_employee_department_name,
|
|
189
|
+
complained_employee_section_id,
|
|
190
|
+
complained_employee_section_name,
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
}
|
|
22
194
|
let LegalComplaintRequest = class LegalComplaintRequest extends BaseModel_1.BaseModel {
|
|
23
195
|
constructor() {
|
|
24
196
|
super();
|
|
@@ -37,18 +209,98 @@ __decorate([
|
|
|
37
209
|
(0, typeorm_1.Column)({ type: 'text', nullable: false }),
|
|
38
210
|
__metadata("design:type", String)
|
|
39
211
|
], LegalComplaintRequest.prototype, "description", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
214
|
+
__metadata("design:type", Object)
|
|
215
|
+
], LegalComplaintRequest.prototype, "incident_time", void 0);
|
|
216
|
+
__decorate([
|
|
217
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
218
|
+
__metadata("design:type", Object)
|
|
219
|
+
], LegalComplaintRequest.prototype, "incident_location", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
222
|
+
__metadata("design:type", Object)
|
|
223
|
+
], LegalComplaintRequest.prototype, "individuals_involved", void 0);
|
|
224
|
+
__decorate([
|
|
225
|
+
(0, typeorm_1.Column)({ type: 'date', nullable: true }),
|
|
226
|
+
__metadata("design:type", Object)
|
|
227
|
+
], LegalComplaintRequest.prototype, "incident_date", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
230
|
+
__metadata("design:type", Object)
|
|
231
|
+
], LegalComplaintRequest.prototype, "incident_events", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
234
|
+
__metadata("design:type", Object)
|
|
235
|
+
], LegalComplaintRequest.prototype, "incident_other_details", void 0);
|
|
40
236
|
__decorate([
|
|
41
237
|
(0, typeorm_1.Column)({ type: 'text', nullable: false }),
|
|
42
238
|
__metadata("design:type", String)
|
|
43
|
-
], LegalComplaintRequest.prototype, "
|
|
239
|
+
], LegalComplaintRequest.prototype, "incident_description", void 0);
|
|
44
240
|
__decorate([
|
|
45
|
-
(0, typeorm_1.Column)({ type: '
|
|
241
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
|
|
46
242
|
__metadata("design:type", String)
|
|
47
|
-
], LegalComplaintRequest.prototype, "
|
|
243
|
+
], LegalComplaintRequest.prototype, "complainant_name", void 0);
|
|
48
244
|
__decorate([
|
|
49
|
-
(0, typeorm_1.Column)({ type: '
|
|
245
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
246
|
+
__metadata("design:type", Object)
|
|
247
|
+
], LegalComplaintRequest.prototype, "complainant_position", void 0);
|
|
248
|
+
__decorate([
|
|
249
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
|
|
250
|
+
__metadata("design:type", Object)
|
|
251
|
+
], LegalComplaintRequest.prototype, "complainant_employee_id", void 0);
|
|
252
|
+
__decorate([
|
|
253
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true }),
|
|
254
|
+
__metadata("design:type", Object)
|
|
255
|
+
], LegalComplaintRequest.prototype, "complainant_directorate", void 0);
|
|
256
|
+
__decorate([
|
|
257
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
258
|
+
__metadata("design:type", Object)
|
|
259
|
+
], LegalComplaintRequest.prototype, "complainant_department_id", void 0);
|
|
260
|
+
__decorate([
|
|
261
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true }),
|
|
262
|
+
__metadata("design:type", Object)
|
|
263
|
+
], LegalComplaintRequest.prototype, "complainant_department_name", void 0);
|
|
264
|
+
__decorate([
|
|
265
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
266
|
+
__metadata("design:type", Object)
|
|
267
|
+
], LegalComplaintRequest.prototype, "complainant_section_id", void 0);
|
|
268
|
+
__decorate([
|
|
269
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true }),
|
|
270
|
+
__metadata("design:type", Object)
|
|
271
|
+
], LegalComplaintRequest.prototype, "complainant_section_name", void 0);
|
|
272
|
+
__decorate([
|
|
273
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
|
|
50
274
|
__metadata("design:type", String)
|
|
51
|
-
], LegalComplaintRequest.prototype, "
|
|
275
|
+
], LegalComplaintRequest.prototype, "complained_employee_name", void 0);
|
|
276
|
+
__decorate([
|
|
277
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
278
|
+
__metadata("design:type", Object)
|
|
279
|
+
], LegalComplaintRequest.prototype, "complained_employee_position", void 0);
|
|
280
|
+
__decorate([
|
|
281
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
|
|
282
|
+
__metadata("design:type", Object)
|
|
283
|
+
], LegalComplaintRequest.prototype, "complained_employee_salary_grade", void 0);
|
|
284
|
+
__decorate([
|
|
285
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true }),
|
|
286
|
+
__metadata("design:type", Object)
|
|
287
|
+
], LegalComplaintRequest.prototype, "complained_employee_directorate", void 0);
|
|
288
|
+
__decorate([
|
|
289
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
290
|
+
__metadata("design:type", Object)
|
|
291
|
+
], LegalComplaintRequest.prototype, "complained_employee_department_id", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true }),
|
|
294
|
+
__metadata("design:type", Object)
|
|
295
|
+
], LegalComplaintRequest.prototype, "complained_employee_department_name", void 0);
|
|
296
|
+
__decorate([
|
|
297
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
298
|
+
__metadata("design:type", Object)
|
|
299
|
+
], LegalComplaintRequest.prototype, "complained_employee_section_id", void 0);
|
|
300
|
+
__decorate([
|
|
301
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true }),
|
|
302
|
+
__metadata("design:type", Object)
|
|
303
|
+
], LegalComplaintRequest.prototype, "complained_employee_section_name", void 0);
|
|
52
304
|
__decorate([
|
|
53
305
|
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
54
306
|
__metadata("design:type", Object)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Role } from './role';
|
|
2
|
+
import { UUIDBaseModel } from './UUIDBaseModel';
|
|
3
|
+
export declare enum PermissionType {
|
|
4
|
+
VIEW = "view",
|
|
5
|
+
UPLOAD = "upload",
|
|
6
|
+
UPDATE = "update",
|
|
7
|
+
DELETE = "delete",
|
|
8
|
+
PUBLISH = "publish"
|
|
9
|
+
}
|
|
10
|
+
export declare class Permission extends UUIDBaseModel {
|
|
11
|
+
name: string;
|
|
12
|
+
code: string;
|
|
13
|
+
type: PermissionType;
|
|
14
|
+
description?: string;
|
|
15
|
+
is_active: boolean;
|
|
16
|
+
roles: Role[];
|
|
17
|
+
constructor(name: string, code: string, type: PermissionType, created_by: string, description?: string, is_active?: boolean);
|
|
18
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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.Permission = exports.PermissionType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const role_1 = require("./role");
|
|
15
|
+
const UUIDBaseModel_1 = require("./UUIDBaseModel");
|
|
16
|
+
var PermissionType;
|
|
17
|
+
(function (PermissionType) {
|
|
18
|
+
PermissionType["VIEW"] = "view";
|
|
19
|
+
PermissionType["UPLOAD"] = "upload";
|
|
20
|
+
PermissionType["UPDATE"] = "update";
|
|
21
|
+
PermissionType["DELETE"] = "delete";
|
|
22
|
+
PermissionType["PUBLISH"] = "publish";
|
|
23
|
+
})(PermissionType || (exports.PermissionType = PermissionType = {}));
|
|
24
|
+
let Permission = class Permission extends UUIDBaseModel_1.UUIDBaseModel {
|
|
25
|
+
constructor(name, code, type, created_by, description, is_active = true) {
|
|
26
|
+
super();
|
|
27
|
+
this.name = name;
|
|
28
|
+
this.code = code;
|
|
29
|
+
this.type = type;
|
|
30
|
+
this.created_by = created_by;
|
|
31
|
+
this.description = description;
|
|
32
|
+
this.is_active = is_active;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.Permission = Permission;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, unique: true }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], Permission.prototype, "name", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50, unique: true }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], Permission.prototype, "code", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: PermissionType }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], Permission.prototype, "type", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], Permission.prototype, "description", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
54
|
+
__metadata("design:type", Boolean)
|
|
55
|
+
], Permission.prototype, "is_active", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.ManyToMany)(() => role_1.Role),
|
|
58
|
+
(0, typeorm_1.JoinTable)({
|
|
59
|
+
name: 'role_permissions',
|
|
60
|
+
joinColumn: { name: 'permission_id', referencedColumnName: 'id' },
|
|
61
|
+
inverseJoinColumn: { name: 'role_id', referencedColumnName: 'id' },
|
|
62
|
+
}),
|
|
63
|
+
__metadata("design:type", Array)
|
|
64
|
+
], Permission.prototype, "roles", void 0);
|
|
65
|
+
exports.Permission = Permission = __decorate([
|
|
66
|
+
(0, typeorm_1.Entity)({ name: 'permissions' }),
|
|
67
|
+
__metadata("design:paramtypes", [String, String, String, String, String, Boolean])
|
|
68
|
+
], Permission);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare abstract class UUIDModel0 {
|
|
2
|
+
jsonIgnore: string[];
|
|
3
|
+
created_by?: string;
|
|
4
|
+
created_at?: Date;
|
|
5
|
+
updated_by?: string;
|
|
6
|
+
updated_at?: Date;
|
|
7
|
+
insertCreated(): void;
|
|
8
|
+
is_deleted?: boolean;
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
11
|
+
export declare abstract class UUIDBaseModel extends UUIDModel0 {
|
|
12
|
+
id: string;
|
|
13
|
+
constructor();
|
|
14
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.UUIDBaseModel = exports.UUIDModel0 = void 0;
|
|
16
|
+
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
17
|
+
const typeorm_1 = require("typeorm");
|
|
18
|
+
class UUIDModel0 {
|
|
19
|
+
insertCreated() {
|
|
20
|
+
const currentTime = (0, moment_timezone_1.default)().utc().tz('Asia/Kolkata').toDate();
|
|
21
|
+
this.created_at = currentTime;
|
|
22
|
+
this.updated_at = currentTime;
|
|
23
|
+
}
|
|
24
|
+
constructor() {
|
|
25
|
+
this.jsonIgnore = ['logicalDelete', 'is_deleted', 'jsonIgnore'];
|
|
26
|
+
this.is_deleted = false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.UUIDModel0 = UUIDModel0;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], UUIDModel0.prototype, "created_by", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.CreateDateColumn)({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" }),
|
|
36
|
+
__metadata("design:type", Date)
|
|
37
|
+
], UUIDModel0.prototype, "created_at", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], UUIDModel0.prototype, "updated_by", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.UpdateDateColumn)({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" }),
|
|
44
|
+
__metadata("design:type", Date)
|
|
45
|
+
], UUIDModel0.prototype, "updated_at", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
48
|
+
__metadata("design:type", Function),
|
|
49
|
+
__metadata("design:paramtypes", []),
|
|
50
|
+
__metadata("design:returntype", void 0)
|
|
51
|
+
], UUIDModel0.prototype, "insertCreated", null);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ nullable: true, default: false }),
|
|
54
|
+
__metadata("design:type", Boolean)
|
|
55
|
+
], UUIDModel0.prototype, "is_deleted", void 0);
|
|
56
|
+
class UUIDBaseModel extends UUIDModel0 {
|
|
57
|
+
constructor() {
|
|
58
|
+
super();
|
|
59
|
+
this.id = ''; // This will be set by the database when the entity is saved
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.UUIDBaseModel = UUIDBaseModel;
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], UUIDBaseModel.prototype, "id", void 0);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -124,6 +124,11 @@ import { CancellationApprovalDetails } from './models/CancellationApprovalModel'
|
|
|
124
124
|
import { CancellationRequestAttachment } from './models/CancellationAttachmentModel';
|
|
125
125
|
import { CancellationRequestChat } from './models/CancellationChatModel';
|
|
126
126
|
import { CancellationWorkFlow } from './models/CancellationWorkflowModel';
|
|
127
|
+
import { EventSupportRequests } from './models/EventSupportRequestModel';
|
|
128
|
+
import { EventSupportApprovalDetails } from './models/EventSupportApprovalModel';
|
|
129
|
+
import { EventSupportRequestAttachment } from './models/EventSupportAttachmentModel';
|
|
130
|
+
import { EventSupportRequestChat } from './models/EventSupportChatModel';
|
|
131
|
+
import { EventSupportWorkFlow } from './models/EventSupportWorkflowModel';
|
|
127
132
|
import { AnnualTrainingPlanRequest } from './models/AnnualTrainingPlanRequestModel';
|
|
128
133
|
import { AnnualTrainingPlanWorkFlow } from './models/AnnualTrainingPlanWorkflowModel';
|
|
129
134
|
import { AnnualTrainingPlanApprovalDetails } from './models/AnnualTrainingPlanApprovalModel';
|
|
@@ -279,6 +284,11 @@ export const AppDataSource = new DataSource({
|
|
|
279
284
|
CancellationRequestAttachment,
|
|
280
285
|
CancellationRequestChat,
|
|
281
286
|
CancellationWorkFlow,
|
|
287
|
+
EventSupportRequests,
|
|
288
|
+
EventSupportApprovalDetails,
|
|
289
|
+
EventSupportRequestAttachment,
|
|
290
|
+
EventSupportRequestChat,
|
|
291
|
+
EventSupportWorkFlow,
|
|
282
292
|
AnnualTrainingPlanRequest,
|
|
283
293
|
AnnualTrainingPlanWorkFlow,
|
|
284
294
|
AnnualTrainingPlanApprovalDetails,
|
package/src/index.ts
CHANGED
|
@@ -105,7 +105,18 @@ export * from './models/CancellationApprovalModel';
|
|
|
105
105
|
export * from './models/CancellationAttachmentModel';
|
|
106
106
|
export * from './models/CancellationChatModel';
|
|
107
107
|
export * from './models/CancellationWorkflowModel';
|
|
108
|
+
export * from './models/EventSupportRequestModel';
|
|
109
|
+
export * from './models/EventSupportApprovalModel';
|
|
110
|
+
export * from './models/EventSupportAttachmentModel';
|
|
111
|
+
export * from './models/EventSupportChatModel';
|
|
112
|
+
export * from './models/EventSupportWorkflowModel';
|
|
108
113
|
export { CancellationRequestStatus } from './models/CancellationRequestModel';
|
|
114
|
+
export { EventSupportRequestStatus } from './models/EventSupportRequestModel';
|
|
115
|
+
export { EventSupportApprovalStatus } from './models/EventSupportApprovalModel';
|
|
116
|
+
export { EventSupportWorkFlowStatus } from './models/EventSupportWorkflowModel';
|
|
117
|
+
export { EventSupportRequestAttachment } from './models/EventSupportAttachmentModel';
|
|
118
|
+
export { EventSupportRequestChat } from './models/EventSupportChatModel';
|
|
119
|
+
export { EventSupportMessageType } from './models/EventSupportChatModel';
|
|
109
120
|
export { CancellationApprovalStatus } from './models/CancellationApprovalModel';
|
|
110
121
|
export { CancellationWorkFlowStatus } from './models/CancellationWorkflowModel';
|
|
111
122
|
export { CancellationRequestAttachment } from './models/CancellationAttachmentModel';
|