@platform-modules/civil-aviation-authority 2.3.310 → 2.3.312
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/dist/data-source.js +2 -0
- package/dist/i18n/workflow-chat-i18n.json +8 -0
- package/dist/i18n/workflow-chat-message.builder.d.ts +1 -1
- package/dist/i18n/workflow-chat-message.builder.js +21 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/models/ChatbotQnsAnsMappingModel.d.ts +8 -0
- package/dist/models/ChatbotQnsAnsMappingModel.js +40 -0
- 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/FolderModel.d.ts +16 -0
- package/dist/models/FolderModel.js +85 -0
- package/dist/models/ImportExportMaterialModels.d.ts +92 -0
- package/dist/models/ImportExportMaterialModels.js +307 -0
- package/dist/models/PermissionModel.d.ts +18 -0
- package/dist/models/PermissionModel.js +68 -0
- package/dist/models/SecurityAccessApprovalModel.d.ts +23 -0
- package/dist/models/SecurityAccessApprovalModel.js +82 -0
- package/dist/models/SecurityAccessAttachmentModel.d.ts +12 -0
- package/dist/models/SecurityAccessAttachmentModel.js +56 -0
- package/dist/models/SecurityAccessChatModel.d.ts +12 -0
- package/dist/models/SecurityAccessChatModel.js +56 -0
- package/dist/models/SecurityAccessRequestModel.d.ts +25 -0
- package/dist/models/SecurityAccessRequestModel.js +80 -0
- package/dist/models/SecurityAccessWorkflowModel.d.ts +24 -0
- package/dist/models/SecurityAccessWorkflowModel.js +84 -0
- package/dist/models/ServiceExtensionAfterAge60Models.d.ts +93 -0
- package/dist/models/ServiceExtensionAfterAge60Models.js +312 -0
- package/dist/models/SlaApprovalsViewModel.js +54 -47
- package/dist/models/SlaMyRequestsViewModel.d.ts +3 -0
- package/dist/models/SlaMyRequestsViewModel.js +22 -2
- package/dist/models/UUIDBaseModel.d.ts +14 -0
- package/dist/models/UUIDBaseModel.js +66 -0
- package/dist/models/WorkingHoursExtensionModels.d.ts +88 -0
- package/dist/models/WorkingHoursExtensionModels.js +295 -0
- package/package.json +1 -1
- package/scripts/sync-sla-reports-sql.js +92 -92
- package/sql/README.md +21 -21
- package/sql/create_chatbot_qns_ans_mapping.sql +25 -0
- package/sql/sla_reports_admin_procedures.sql +323 -304
- package/sql/sla_reports_approvals_workbook.sql +430 -383
- package/sql/sla_reports_procedures.sql +886 -886
- package/sql/user_role_department_section_validation.sql +214 -0
- package/sql/vw_sla_approvals.sql +115 -108
- package/sql/vw_sla_my_requests.sql +58 -53
- package/src/data-source.ts +2 -0
- package/src/i18n/workflow-chat-i18n.json +8 -0
- package/src/i18n/workflow-chat-message.builder.ts +27 -3
- package/src/index.ts +1 -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/ChatbotQnsAnsMappingModel.ts +21 -0
- package/src/models/DocumentDriveModel.ts +28 -28
- package/src/models/DocumentFolderModel.ts +45 -45
- package/src/models/HotelApprovalModel.ts +83 -83
- package/src/models/HousingContractCancelApprovalModel.ts +64 -64
- package/src/models/HousingContractRenewalApprovalModel.ts +64 -64
- package/src/models/ITRequestAttachmentModel.ts +73 -73
- package/src/models/ItApprovalsModel.ts +84 -84
- package/src/models/LegalConsultationApprovalModel.ts +65 -65
- package/src/models/MissionTravelPassportExpiryNotificationConfigModel.ts +36 -36
- package/src/models/NotificationModel.ts +89 -89
- package/src/models/ResidentialUnitRentalApprovalModel.ts +143 -143
- package/src/models/ServiceExtensionAfter60ApprovalModel.ts +87 -87
- package/src/models/ServiceSlaApprovalModel.ts +64 -64
- package/src/models/ServicesNotificationConfigModel.ts +55 -55
- package/src/models/SlaApprovalsViewModel.ts +142 -135
- package/src/models/SlaMyRequestsViewModel.ts +21 -1
- 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 +34 -34
- package/src/sla/sla-table-sync.service.ts +90 -90
- package/dist/helpers/cancellation-bilingual-persist.helper.d.ts +0 -37
- package/dist/helpers/cancellation-bilingual-persist.helper.js +0 -77
package/dist/data-source.js
CHANGED
|
@@ -256,6 +256,7 @@ const SlaMyRequestsViewModel_1 = require("./models/SlaMyRequestsViewModel");
|
|
|
256
256
|
const SlaApprovalsViewModel_1 = require("./models/SlaApprovalsViewModel");
|
|
257
257
|
const ServiceSlaApprovalModel_1 = require("./models/ServiceSlaApprovalModel");
|
|
258
258
|
const SlaConfigModel_1 = require("./models/SlaConfigModel");
|
|
259
|
+
const ChatbotQnsAnsMappingModel_1 = require("./models/ChatbotQnsAnsMappingModel");
|
|
259
260
|
const CSRMBusinessImpactRatingMasterModel_1 = require("./models/CSRMBusinessImpactRatingMasterModel");
|
|
260
261
|
const CSRMLikelihoodMasterModel_1 = require("./models/CSRMLikelihoodMasterModel");
|
|
261
262
|
const LocationModel_1 = require("./models/LocationModel");
|
|
@@ -579,6 +580,7 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
579
580
|
SlaApprovalsViewModel_1.SlaApprovalsView,
|
|
580
581
|
ServiceSlaApprovalModel_1.ServiceSlaApproval,
|
|
581
582
|
SlaConfigModel_1.SlaConfig,
|
|
583
|
+
ChatbotQnsAnsMappingModel_1.ChatbotQnsAnsMapping,
|
|
582
584
|
CSRMBusinessImpactRatingMasterModel_1.CSRMBusinessImpactRatingMaster,
|
|
583
585
|
CSRMLikelihoodMasterModel_1.CSRMLikelihoodMaster,
|
|
584
586
|
LocationModel_1.Location,
|
|
@@ -309,6 +309,14 @@
|
|
|
309
309
|
"logistics_actual_return_updated": {
|
|
310
310
|
"en": "{{roleName}} updated the Vehicle Actual Return Date, Time, and Reason. Actual Return Date: {{date}}, Actual Return Time: {{time}}, Reason: {{reason}}",
|
|
311
311
|
"ar": "قام {{roleName}} بتحديث تاريخ الإرجاع الفعلي للمركبة والوقت والسبب. تاريخ الإرجاع الفعلي: {{date}}، وقت الإرجاع الفعلي: {{time}}، السبب: {{reason}}"
|
|
312
|
+
},
|
|
313
|
+
"pending_with_user": {
|
|
314
|
+
"en": "Pending with {{userName}} ({{employeeId}})",
|
|
315
|
+
"ar": "قيد الانتظار لدى {{userName}} ({{employeeId}})"
|
|
316
|
+
},
|
|
317
|
+
"pending_with_role": {
|
|
318
|
+
"en": "Pending with {{roleName}}",
|
|
319
|
+
"ar": "قيد الانتظار لدى {{roleName}}"
|
|
312
320
|
}
|
|
313
321
|
},
|
|
314
322
|
"notificationTemplates": {
|
|
@@ -348,7 +348,7 @@ export declare function buildItHelpdeskCloseNotificationMessage(params: {
|
|
|
348
348
|
status: 'Approved' | 'Rejected';
|
|
349
349
|
}): BilingualText;
|
|
350
350
|
export declare function resolveWorkflowStatusAr(status: string | null | undefined): string | null;
|
|
351
|
-
export declare function resolveChatStatusAr(status: string | null | undefined): string | null;
|
|
351
|
+
export declare function resolveChatStatusAr(status: string | null | undefined, actors?: BilingualActorNames): string | null;
|
|
352
352
|
/** Pull bilingual actor fields from joined relations on workflow/chat rows. */
|
|
353
353
|
export declare function extractBilingualActorsFromRecord(record: Record<string, unknown>): BilingualActorNames;
|
|
354
354
|
export declare function resolveWorkflowContentAr(content: string | null | undefined, actors?: BilingualActorNames): string | null;
|
|
@@ -951,10 +951,28 @@ function resolveWorkflowStatusAr(status) {
|
|
|
951
951
|
return null;
|
|
952
952
|
return WORKFLOW_STATUS_LABELS[status] ?? status;
|
|
953
953
|
}
|
|
954
|
-
function resolveChatStatusAr(status) {
|
|
954
|
+
function resolveChatStatusAr(status, actors) {
|
|
955
955
|
if (status == null || status === '')
|
|
956
956
|
return null;
|
|
957
|
-
|
|
957
|
+
const labeled = CHAT_STATUS_LABELS[status];
|
|
958
|
+
if (labeled)
|
|
959
|
+
return labeled;
|
|
960
|
+
const normalized = status.trim();
|
|
961
|
+
const pendingWithUserTpl = CHAT_TEMPLATES.pending_with_user;
|
|
962
|
+
if (pendingWithUserTpl) {
|
|
963
|
+
const params = matchTemplateMessage(pendingWithUserTpl.en, normalized);
|
|
964
|
+
if (params) {
|
|
965
|
+
return interpolate(pendingWithUserTpl.ar, buildArabicChatTemplateParams(params, actors));
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
const pendingWithRoleTpl = CHAT_TEMPLATES.pending_with_role;
|
|
969
|
+
if (pendingWithRoleTpl) {
|
|
970
|
+
const params = matchTemplateMessage(pendingWithRoleTpl.en, normalized);
|
|
971
|
+
if (params) {
|
|
972
|
+
return interpolate(pendingWithRoleTpl.ar, buildArabicChatTemplateParams(params, actors));
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
return status;
|
|
958
976
|
}
|
|
959
977
|
// ─── Legacy row enrichment (read API) ────────────────────────────────────────
|
|
960
978
|
/** Pull bilingual actor fields from joined relations on workflow/chat rows. */
|
|
@@ -1599,7 +1617,7 @@ function enrichChatMessage(chat) {
|
|
|
1599
1617
|
return {
|
|
1600
1618
|
...chat,
|
|
1601
1619
|
message_ar: chat.message_ar ?? resolveChatMessageAr(message, actors),
|
|
1602
|
-
status_ar: chat.status_ar ?? resolveChatStatusAr(status),
|
|
1620
|
+
status_ar: chat.status_ar ?? resolveChatStatusAr(status, actors),
|
|
1603
1621
|
};
|
|
1604
1622
|
}
|
|
1605
1623
|
/** @deprecated Use enrichWorkflowLog */
|
package/dist/index.d.ts
CHANGED
|
@@ -414,6 +414,7 @@ export * from './models/RequestTenderAnalysisRequestModel';
|
|
|
414
414
|
export * from './models/ContractServiceRequestModel';
|
|
415
415
|
export * from './models/ContractServiceRequestDocumentModel';
|
|
416
416
|
export * from './models/SlaConfigModel';
|
|
417
|
+
export * from './models/ChatbotQnsAnsMappingModel';
|
|
417
418
|
export * from './models/SlaRequestModel';
|
|
418
419
|
export * from './models/SlaMyRequestsViewModel';
|
|
419
420
|
export * from './models/SlaApprovalsViewModel';
|
package/dist/index.js
CHANGED
|
@@ -603,6 +603,7 @@ __exportStar(require("./models/RequestTenderAnalysisRequestModel"), exports);
|
|
|
603
603
|
__exportStar(require("./models/ContractServiceRequestModel"), exports);
|
|
604
604
|
__exportStar(require("./models/ContractServiceRequestDocumentModel"), exports);
|
|
605
605
|
__exportStar(require("./models/SlaConfigModel"), exports);
|
|
606
|
+
__exportStar(require("./models/ChatbotQnsAnsMappingModel"), exports);
|
|
606
607
|
__exportStar(require("./models/SlaRequestModel"), exports);
|
|
607
608
|
__exportStar(require("./models/SlaMyRequestsViewModel"), exports);
|
|
608
609
|
__exportStar(require("./models/SlaApprovalsViewModel"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseModel } from "./BaseModel";
|
|
2
|
+
export declare class ChatbotQnsAnsMapping extends BaseModel {
|
|
3
|
+
service_id: number;
|
|
4
|
+
sub_service_id: number;
|
|
5
|
+
question: Record<string, unknown> | unknown[];
|
|
6
|
+
answer: Record<string, unknown> | unknown[];
|
|
7
|
+
constructor();
|
|
8
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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.ChatbotQnsAnsMapping = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let ChatbotQnsAnsMapping = class ChatbotQnsAnsMapping extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.ChatbotQnsAnsMapping = ChatbotQnsAnsMapping;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)({ type: "int", nullable: false }),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], ChatbotQnsAnsMapping.prototype, "service_id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ type: "int", nullable: false }),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], ChatbotQnsAnsMapping.prototype, "sub_service_id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: "jsonb", nullable: false }),
|
|
31
|
+
__metadata("design:type", Object)
|
|
32
|
+
], ChatbotQnsAnsMapping.prototype, "question", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: "jsonb", nullable: false }),
|
|
35
|
+
__metadata("design:type", Object)
|
|
36
|
+
], ChatbotQnsAnsMapping.prototype, "answer", void 0);
|
|
37
|
+
exports.ChatbotQnsAnsMapping = ChatbotQnsAnsMapping = __decorate([
|
|
38
|
+
(0, typeorm_1.Entity)({ name: "chatbot_qns_ans_mapping" }),
|
|
39
|
+
__metadata("design:paramtypes", [])
|
|
40
|
+
], ChatbotQnsAnsMapping);
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
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);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
/**
|
|
3
|
+
* Documentation Service specific department configuration
|
|
4
|
+
* Links departments with authorized persons for document management
|
|
5
|
+
*/
|
|
6
|
+
export declare class DocumentationDepartments extends BaseModel {
|
|
7
|
+
department_id: number;
|
|
8
|
+
authorized_person_id: string;
|
|
9
|
+
authorized_person_name?: string;
|
|
10
|
+
authorized_person_email?: string;
|
|
11
|
+
is_active: boolean;
|
|
12
|
+
constructor(department_id: number, authorized_person_id: string, authorized_person_name: string, authorized_person_email: string, is_active?: boolean);
|
|
13
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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.DocumentationDepartments = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
/**
|
|
16
|
+
* Documentation Service specific department configuration
|
|
17
|
+
* Links departments with authorized persons for document management
|
|
18
|
+
*/
|
|
19
|
+
let DocumentationDepartments = class DocumentationDepartments extends BaseModel_1.BaseModel {
|
|
20
|
+
constructor(department_id, authorized_person_id, authorized_person_name, authorized_person_email, is_active = true) {
|
|
21
|
+
super();
|
|
22
|
+
this.department_id = department_id;
|
|
23
|
+
this.authorized_person_id = authorized_person_id;
|
|
24
|
+
this.authorized_person_name = authorized_person_name;
|
|
25
|
+
this.authorized_person_email = authorized_person_email;
|
|
26
|
+
this.is_active = is_active;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.DocumentationDepartments = DocumentationDepartments;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], DocumentationDepartments.prototype, "department_id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], DocumentationDepartments.prototype, "authorized_person_id", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], DocumentationDepartments.prototype, "authorized_person_name", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], DocumentationDepartments.prototype, "authorized_person_email", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
48
|
+
__metadata("design:type", Boolean)
|
|
49
|
+
], DocumentationDepartments.prototype, "is_active", void 0);
|
|
50
|
+
exports.DocumentationDepartments = DocumentationDepartments = __decorate([
|
|
51
|
+
(0, typeorm_1.Entity)({ name: 'documentation_departments' }),
|
|
52
|
+
__metadata("design:paramtypes", [Number, String, String, String, Boolean])
|
|
53
|
+
], DocumentationDepartments);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Departments } from './DepartmentsModel';
|
|
2
|
+
import { UUIDBaseModel } from './UUIDBaseModel';
|
|
3
|
+
export declare class Folder extends UUIDBaseModel {
|
|
4
|
+
name: string;
|
|
5
|
+
path: string;
|
|
6
|
+
parent_path?: string;
|
|
7
|
+
department: Departments;
|
|
8
|
+
department_id: number;
|
|
9
|
+
description?: string;
|
|
10
|
+
access_level: 'general' | 'restricted';
|
|
11
|
+
allowed_roles: string[];
|
|
12
|
+
allowed_users: string[];
|
|
13
|
+
created_by_name?: string;
|
|
14
|
+
is_active: boolean;
|
|
15
|
+
constructor(name: string, path: string, department_id: number, created_by: string, access_level?: 'general' | 'restricted', parent_path?: string, description?: string, created_by_name?: string, allowed_roles?: string[], allowed_users?: string[], is_active?: boolean);
|
|
16
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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.Folder = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const DepartmentsModel_1 = require("./DepartmentsModel");
|
|
15
|
+
const UUIDBaseModel_1 = require("./UUIDBaseModel");
|
|
16
|
+
// Note: DocumentMetadata import removed to avoid circular dependency
|
|
17
|
+
// Use lazy loading or query builder when needed
|
|
18
|
+
let Folder = class Folder extends UUIDBaseModel_1.UUIDBaseModel {
|
|
19
|
+
constructor(name, path, department_id, created_by, access_level = 'general', parent_path, description, created_by_name, allowed_roles, allowed_users, is_active = true) {
|
|
20
|
+
super();
|
|
21
|
+
this.name = name;
|
|
22
|
+
this.path = path;
|
|
23
|
+
this.department_id = department_id;
|
|
24
|
+
this.created_by = created_by;
|
|
25
|
+
this.access_level = access_level;
|
|
26
|
+
this.parent_path = parent_path;
|
|
27
|
+
this.description = description;
|
|
28
|
+
this.created_by_name = created_by_name;
|
|
29
|
+
this.allowed_roles = allowed_roles || [];
|
|
30
|
+
this.allowed_users = allowed_users || [];
|
|
31
|
+
this.is_active = is_active;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.Folder = Folder;
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], Folder.prototype, "name", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 1000 }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], Folder.prototype, "path", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 1000, nullable: true }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], Folder.prototype, "parent_path", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.ManyToOne)('Departments', { eager: true }),
|
|
49
|
+
(0, typeorm_1.JoinColumn)({ name: 'department_id' }),
|
|
50
|
+
__metadata("design:type", DepartmentsModel_1.Departments)
|
|
51
|
+
], Folder.prototype, "department", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
54
|
+
__metadata("design:type", Number)
|
|
55
|
+
], Folder.prototype, "department_id", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], Folder.prototype, "description", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: ['general', 'restricted'], default: 'general' }),
|
|
62
|
+
(0, typeorm_1.Index)(),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], Folder.prototype, "access_level", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({ type: 'text', array: true, default: [] }),
|
|
67
|
+
__metadata("design:type", Array)
|
|
68
|
+
], Folder.prototype, "allowed_roles", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({ type: 'text', array: true, default: [] }),
|
|
71
|
+
__metadata("design:type", Array)
|
|
72
|
+
], Folder.prototype, "allowed_users", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], Folder.prototype, "created_by_name", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
79
|
+
(0, typeorm_1.Index)(),
|
|
80
|
+
__metadata("design:type", Boolean)
|
|
81
|
+
], Folder.prototype, "is_active", void 0);
|
|
82
|
+
exports.Folder = Folder = __decorate([
|
|
83
|
+
(0, typeorm_1.Entity)({ name: 'folders' }),
|
|
84
|
+
__metadata("design:paramtypes", [String, String, Number, String, String, String, String, String, Array, Array, Boolean])
|
|
85
|
+
], Folder);
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { BaseModel } from "./BaseModel";
|
|
2
|
+
export declare enum ImportExportMaterialRequestStatus {
|
|
3
|
+
Pending = "Pending",
|
|
4
|
+
Approved = "Approved",
|
|
5
|
+
Rejected = "Rejected",
|
|
6
|
+
RFC = "RFC"
|
|
7
|
+
}
|
|
8
|
+
export declare enum ImportExportMaterialWorkflowStatus {
|
|
9
|
+
Pending = "Pending",
|
|
10
|
+
InProgress = "In Progress",
|
|
11
|
+
Completed = "Completed",
|
|
12
|
+
Approved = "Approved",
|
|
13
|
+
Rejected = "Rejected"
|
|
14
|
+
}
|
|
15
|
+
export declare class ImportExportMaterialPermissionRequest extends BaseModel {
|
|
16
|
+
req_user_department_id: number | null;
|
|
17
|
+
req_user_section_id: number | null;
|
|
18
|
+
service_id: number | null;
|
|
19
|
+
sub_service_id: number | null;
|
|
20
|
+
user_id: number;
|
|
21
|
+
date_of_request: Date;
|
|
22
|
+
/** import | export | both */
|
|
23
|
+
request_type: string;
|
|
24
|
+
requested_material_movement_date: Date;
|
|
25
|
+
hazardous_or_sensitive_details: string | null;
|
|
26
|
+
purpose: string;
|
|
27
|
+
material_name_description: string;
|
|
28
|
+
mode_of_transport: string;
|
|
29
|
+
vehicle_number: string | null;
|
|
30
|
+
description: string;
|
|
31
|
+
status: string;
|
|
32
|
+
workflow_execution_id: string | null;
|
|
33
|
+
created_by: number;
|
|
34
|
+
}
|
|
35
|
+
export declare enum ImportExportMaterialApprovalStatus {
|
|
36
|
+
Pending = "Pending",
|
|
37
|
+
InProgress = "In Progress",
|
|
38
|
+
Approved = "Approved",
|
|
39
|
+
Rejected = "Rejected",
|
|
40
|
+
Reassigned = "Reassigned"
|
|
41
|
+
}
|
|
42
|
+
export declare class ImportExportMaterialPermissionApproval extends BaseModel {
|
|
43
|
+
request_id: number;
|
|
44
|
+
service_id: number | null;
|
|
45
|
+
sub_service_id: number | null;
|
|
46
|
+
level: number;
|
|
47
|
+
approver_user_id: number | null;
|
|
48
|
+
approver_role_id: number | null;
|
|
49
|
+
department_id: number | null;
|
|
50
|
+
section_id: number | null;
|
|
51
|
+
delegate_user_id: number | null;
|
|
52
|
+
comment: string;
|
|
53
|
+
approval_status: string;
|
|
54
|
+
}
|
|
55
|
+
export declare class ImportExportMaterialPermissionWorkflow extends BaseModel {
|
|
56
|
+
request_id: number;
|
|
57
|
+
service_id: number | null;
|
|
58
|
+
sub_service_id: number | null;
|
|
59
|
+
workflow_definition_id: number | null;
|
|
60
|
+
current_level: number | null;
|
|
61
|
+
content: string | null;
|
|
62
|
+
status: string;
|
|
63
|
+
step_order: number | null;
|
|
64
|
+
user_id: number | null;
|
|
65
|
+
role_id: number | null;
|
|
66
|
+
department_id: number | null;
|
|
67
|
+
section_id: number | null;
|
|
68
|
+
workflow_data: string | null;
|
|
69
|
+
created_by: number;
|
|
70
|
+
}
|
|
71
|
+
export declare class ImportExportMaterialPermissionChat extends BaseModel {
|
|
72
|
+
request_id: number;
|
|
73
|
+
service_id: number;
|
|
74
|
+
sub_service_id: number;
|
|
75
|
+
user_id: number;
|
|
76
|
+
approver_role_id: number | null;
|
|
77
|
+
message: string;
|
|
78
|
+
message_type: string;
|
|
79
|
+
status: string | null;
|
|
80
|
+
is_internal: boolean;
|
|
81
|
+
created_by: number;
|
|
82
|
+
}
|
|
83
|
+
export declare class ImportExportMaterialPermissionAttachment extends BaseModel {
|
|
84
|
+
request_id: number;
|
|
85
|
+
service_id: number;
|
|
86
|
+
sub_service_id: number;
|
|
87
|
+
file_name: string;
|
|
88
|
+
file_url: string;
|
|
89
|
+
file_type: string | null;
|
|
90
|
+
file_size: number | null;
|
|
91
|
+
created_by: number;
|
|
92
|
+
}
|