@platform-modules/civil-aviation-authority 2.3.87 → 2.3.90

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.
Files changed (66) hide show
  1. package/.env +17 -9
  2. package/dist/data-source.js +13 -1
  3. package/dist/index.d.ts +8 -0
  4. package/dist/index.js +17 -1
  5. package/dist/models/DepartmentDocumentOwnerModel.d.ts +10 -0
  6. package/dist/models/DepartmentDocumentOwnerModel.js +44 -0
  7. package/dist/models/DocumentAuditLogModel.d.ts +13 -0
  8. package/dist/models/DocumentAuditLogModel.js +60 -0
  9. package/dist/models/DocumentFolderModel.d.ts +14 -0
  10. package/dist/models/DocumentFolderModel.js +60 -0
  11. package/dist/models/DocumentMetadataModel.d.ts +45 -0
  12. package/dist/models/DocumentMetadataModel.js +171 -0
  13. package/dist/models/DocumentModel.d.ts +25 -0
  14. package/dist/models/DocumentModel.js +96 -0
  15. package/dist/models/DocumentPermissionModel.d.ts +11 -0
  16. package/dist/models/DocumentPermissionModel.js +52 -0
  17. package/dist/models/DocumentTypeModel.d.ts +8 -0
  18. package/dist/models/{ITServicesTypesMuscatModel.js → DocumentTypeModel.js} +19 -16
  19. package/dist/models/DocumentationDepartmentsModel.d.ts +13 -0
  20. package/dist/models/DocumentationDepartmentsModel.js +53 -0
  21. package/dist/models/FolderModel.d.ts +16 -0
  22. package/dist/models/FolderModel.js +85 -0
  23. package/dist/models/HumanResourceAnnualPlanningRequestModel.d.ts +35 -0
  24. package/dist/models/HumanResourceAnnualPlanningRequestModel.js +121 -0
  25. package/dist/models/HumanResourceAnnualPlanningTaskModel.d.ts +25 -0
  26. package/dist/models/HumanResourceAnnualPlanningTaskModel.js +83 -0
  27. package/dist/models/PerformanceCyclePeriodModel.d.ts +7 -0
  28. package/dist/models/PerformanceCyclePeriodModel.js +40 -0
  29. package/dist/models/PerformanceGoalMasterModel.d.ts +8 -0
  30. package/dist/models/PerformanceGoalMasterModel.js +45 -0
  31. package/dist/models/PerformanceManagementRequestModel.d.ts +34 -0
  32. package/dist/models/PerformanceManagementRequestModel.js +128 -0
  33. package/dist/models/PermissionModel.d.ts +18 -0
  34. package/dist/models/PermissionModel.js +68 -0
  35. package/dist/models/UUIDBaseModel.d.ts +14 -0
  36. package/dist/models/UUIDBaseModel.js +66 -0
  37. package/package.json +1 -1
  38. package/src/data-source.ts +13 -1
  39. package/src/index.ts +13 -1
  40. package/src/models/DepartmentDocumentOwnerModel.ts +25 -0
  41. package/src/models/DepartmentsModel.ts +25 -25
  42. package/src/models/DocumentAuditLogModel.ts +38 -0
  43. package/src/models/DocumentFolderModel.ts +37 -0
  44. package/src/models/DocumentModel.ts +65 -0
  45. package/src/models/DocumentPermissionModel.ts +32 -0
  46. package/src/models/DocumentTypeModel.ts +19 -0
  47. package/src/models/HumanResourceAnnualPlanningRequestModel.ts +108 -0
  48. package/src/models/HumanResourceAnnualPlanningTaskModel.ts +70 -0
  49. package/src/models/ITRequestChatModel.ts +62 -62
  50. package/src/models/ItApprovalsModel.ts +84 -84
  51. package/src/models/ItWorkflowModel.ts +55 -55
  52. package/src/models/MissionTravelPassportExpiryNotificationConfigModel.ts +36 -36
  53. package/src/models/PerformanceCyclePeriodModel.ts +23 -0
  54. package/src/models/PerformanceGoalMasterModel.ts +27 -0
  55. package/src/models/PerformanceManagementRequestModel.ts +115 -0
  56. package/src/models/ServicesNotificationConfigModel.ts +55 -55
  57. package/src/models/TrainingRoomNotificationConfigModel.ts +30 -30
  58. package/dist/models/HotelreservationModal.d.ts +0 -30
  59. package/dist/models/HotelreservationModal.js +0 -119
  60. package/dist/models/ITApprovalSettings.d.ts +0 -7
  61. package/dist/models/ITApprovalSettings.js +0 -40
  62. package/dist/models/ITServicesTypesMuscatModel.d.ts +0 -6
  63. package/dist/models/ITServicesTypesSalalahModel.d.ts +0 -6
  64. package/dist/models/ITServicesTypesSalalahModel.js +0 -34
  65. package/dist/models/Workflows.d.ts +0 -0
  66. package/dist/models/Workflows.js +0 -31
package/.env CHANGED
@@ -1,12 +1,20 @@
1
- # DB_HOST=164.52.222.169
1
+ DB_HOST=164.52.222.169
2
+ DB_PORT=5432
3
+ DB_USER=postgres_admin_user
4
+ DB_PASS=pg_admin_user_pwd_caa_fa_$%^&OIukhjgcvbn
5
+ DB_NAME=CAA
6
+
7
+ # DB_HOST=216.48.187.46
2
8
  # DB_PORT=5432
3
- # DB_USER=postgres_admin_user
4
- # DB_PASS=pg_admin_user_pwd_caa_fa_$%^&OIukhjgcvbn
5
- # DB_NAME=CAA
9
+ # DB_USER=adminuser
10
+ # DB_PASS=postgres_caa_fm_qa_34567
11
+ # DB_NAME=CAA_QA
6
12
 
7
13
 
8
- DB_HOST=localhost
9
- DB_PORT=5432
10
- DB_USER=postgres
11
- DB_PASS=stevejobs
12
- DB_NAME=CAA
14
+
15
+
16
+ # DB_HOST=localhost
17
+ # DB_PORT=5432
18
+ # DB_USER=postgres
19
+ # DB_PASS=stevejobs
20
+ # DB_NAME=CAA
@@ -99,6 +99,12 @@ const AssignTasksEmpApprovalModel_1 = require("./models/AssignTasksEmpApprovalMo
99
99
  const AssignTasksEmpWorkflowModel_1 = require("./models/AssignTasksEmpWorkflowModel");
100
100
  const AssignTasksEmpAttachmentModel_1 = require("./models/AssignTasksEmpAttachmentModel");
101
101
  const AssignTasksEmpChatModel_1 = require("./models/AssignTasksEmpChatModel");
102
+ const DocumentModel_1 = require("./models/DocumentModel");
103
+ const DocumentFolderModel_1 = require("./models/DocumentFolderModel");
104
+ const DocumentTypeModel_1 = require("./models/DocumentTypeModel");
105
+ const DocumentPermissionModel_1 = require("./models/DocumentPermissionModel");
106
+ const DocumentAuditLogModel_1 = require("./models/DocumentAuditLogModel");
107
+ const DepartmentDocumentOwnerModel_1 = require("./models/DepartmentDocumentOwnerModel");
102
108
  const TrainingWorkflowModel_1 = require("./models/TrainingWorkflowModel");
103
109
  const TrainingApprovalModel_1 = require("./models/TrainingApprovalModel");
104
110
  const TrainingChatModel_1 = require("./models/TrainingChatModel");
@@ -261,6 +267,12 @@ exports.AppDataSource = new typeorm_1.DataSource({
261
267
  PromotionRequestModel_1.PromotionRequest,
262
268
  AnnualIncrementRequestModel_1.AnnualIncrementRequest,
263
269
  SkillsEnhancementRequestModel_1.SkillsEnhancementRequest,
264
- CityMasterModel_1.CityMaster
270
+ CityMasterModel_1.CityMaster,
271
+ DocumentModel_1.Document,
272
+ DocumentFolderModel_1.DocumentFolder,
273
+ DocumentTypeModel_1.DocumentType,
274
+ DocumentPermissionModel_1.DocumentPermission,
275
+ DocumentAuditLogModel_1.DocumentAuditLog,
276
+ DepartmentDocumentOwnerModel_1.DepartmentDocumentOwner
265
277
  ],
266
278
  });
package/dist/index.d.ts CHANGED
@@ -205,3 +205,11 @@ export * from './models/AnnualIncrementRequestModel';
205
205
  export { AnnualIncrementRequestStatus } from './models/AnnualIncrementRequestModel';
206
206
  export * from './models/SkillsEnhancementRequestModel';
207
207
  export { SkillsEnhancementRequestStatus } from './models/SkillsEnhancementRequestModel';
208
+ export * from './models/PerformanceManagementRequestModel';
209
+ export { PerformanceManagementRequestStatus, PerformanceManagementCyclePeriod } from './models/PerformanceManagementRequestModel';
210
+ export * from './models/PerformanceCyclePeriodModel';
211
+ export * from './models/PerformanceGoalMasterModel';
212
+ export * from './models/HumanResourceAnnualPlanningRequestModel';
213
+ export { HumanResourceAnnualPlanningRequestStatus, Quarter } from './models/HumanResourceAnnualPlanningRequestModel';
214
+ export * from './models/HumanResourceAnnualPlanningTaskModel';
215
+ export { RepeatFrequency, DurationUnit } from './models/HumanResourceAnnualPlanningTaskModel';
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.RequestForCoverageWorkFlowStatus = exports.RequestForCoverageNewsSize = exports.RequestForCoverageRequestStatus = exports.ServiceTransferRequestType = exports.SalaryDetailsType = exports.ServiceTransferRequestStatus = exports.TemporaryAssignmentRequestType = exports.TemporaryAssignmentRequestStatus = exports.SecondmentRequestStatus = exports.TrainingRoomBookingChatStatus = exports.TrainingRoomBookingMessageType = exports.TrainingRoomBookingRequestChat = exports.TrainingRoomBookingRequestAttachment = exports.TrainingRoomBookingWorkFlowStatus = exports.TrainingRoomBookingApprovalStatus = exports.TrainingRoomBookingRoomType = exports.TrainingRoomBookingRequestStatus = exports.AnnualTrainingPlanChatStatus = exports.AnnualTrainingPlanMessageType = exports.AnnualTrainingPlanRequestChat = exports.AnnualTrainingPlanRequestAttachment = exports.AnnualTrainingPlanWorkFlowStatus = exports.AnnualTrainingPlanApprovalStatus = exports.AnnualTrainingPlanPlace = exports.AnnualTrainingPlanRequestStatus = exports.StudyLeaveChatStatus = exports.StudyLeaveMessageType = exports.StudyLeaveRequestChat = exports.StudyLeaveRequestAttachment = exports.StudyLeaveWorkFlowStatus = exports.StudyLeaveApprovalStatus = exports.StudyLeaveRequestStatus = exports.TrainingMessageType = exports.TrainingRequestChat = exports.TrainingRequestAttachment = exports.TrainingWorkFlowStatus = exports.TrainingApprovalStatus = exports.TrainingRequestStatus = exports.HrServiceChatStatus = exports.HrServiceMessageType = exports.HrServiceRequestChat = exports.HrServiceRequestAttachment = exports.HrServiceWorkFlowStatus = exports.HrServiceApprovalStatus = exports.HrServiceRequestStatus = exports.LogisticsVehicleMaintenanceWorkFlowStatus = exports.LogisticsVehicleMaintenanceMessageType = exports.LogisticsVehicleMaintenanceApprovalStatus = exports.VehicleMaintenanceStatus = exports.VehicleMaintenanceType = void 0;
18
- exports.SkillsEnhancementRequestStatus = exports.AnnualIncrementRequestStatus = exports.PromotionRequestStatus = exports.CashAllowanceLeaveRequestStatus = exports.NotificationFrequency = exports.ServicesNotificationTriggerType = exports.NewResourceRequestStatus = exports.JobTransferRequestStatus = exports.ShiftAllowanceValue = exports.ShiftAllowanceRequestStatus = exports.AssignTasksEmpMessageType = exports.AssignTasksEmpRequestChat = exports.AssignTasksEmpRequestAttachment = exports.AssignTasksEmpWorkFlowStatus = exports.AssignTasksEmpApprovalStatus = exports.AssignTasksEmpPriority = exports.AssignTasksEmpStatus = exports.RequestForCoverageRequestAttachment = exports.RequestForCoverageChatStatus = exports.RequestForCoverageMessageType = exports.RequestForCoverageRequestChat = exports.RequestForCoverageApprovalStatus = void 0;
18
+ exports.DurationUnit = exports.RepeatFrequency = exports.Quarter = exports.HumanResourceAnnualPlanningRequestStatus = exports.PerformanceManagementCyclePeriod = exports.PerformanceManagementRequestStatus = exports.SkillsEnhancementRequestStatus = exports.AnnualIncrementRequestStatus = exports.PromotionRequestStatus = exports.CashAllowanceLeaveRequestStatus = exports.NotificationFrequency = exports.ServicesNotificationTriggerType = exports.NewResourceRequestStatus = exports.JobTransferRequestStatus = exports.ShiftAllowanceValue = exports.ShiftAllowanceRequestStatus = exports.AssignTasksEmpMessageType = exports.AssignTasksEmpRequestChat = exports.AssignTasksEmpRequestAttachment = exports.AssignTasksEmpWorkFlowStatus = exports.AssignTasksEmpApprovalStatus = exports.AssignTasksEmpPriority = exports.AssignTasksEmpStatus = exports.RequestForCoverageRequestAttachment = exports.RequestForCoverageChatStatus = exports.RequestForCoverageMessageType = exports.RequestForCoverageRequestChat = exports.RequestForCoverageApprovalStatus = void 0;
19
19
  __exportStar(require("./models/user"), exports);
20
20
  __exportStar(require("./models/role"), exports);
21
21
  __exportStar(require("./models/user-sessions"), exports);
@@ -311,3 +311,19 @@ Object.defineProperty(exports, "AnnualIncrementRequestStatus", { enumerable: tru
311
311
  __exportStar(require("./models/SkillsEnhancementRequestModel"), exports);
312
312
  var SkillsEnhancementRequestModel_1 = require("./models/SkillsEnhancementRequestModel");
313
313
  Object.defineProperty(exports, "SkillsEnhancementRequestStatus", { enumerable: true, get: function () { return SkillsEnhancementRequestModel_1.SkillsEnhancementRequestStatus; } });
314
+ // Performance Management Service
315
+ __exportStar(require("./models/PerformanceManagementRequestModel"), exports);
316
+ var PerformanceManagementRequestModel_1 = require("./models/PerformanceManagementRequestModel");
317
+ Object.defineProperty(exports, "PerformanceManagementRequestStatus", { enumerable: true, get: function () { return PerformanceManagementRequestModel_1.PerformanceManagementRequestStatus; } });
318
+ Object.defineProperty(exports, "PerformanceManagementCyclePeriod", { enumerable: true, get: function () { return PerformanceManagementRequestModel_1.PerformanceManagementCyclePeriod; } });
319
+ __exportStar(require("./models/PerformanceCyclePeriodModel"), exports);
320
+ __exportStar(require("./models/PerformanceGoalMasterModel"), exports);
321
+ // Human Resource Annual Planning Service
322
+ __exportStar(require("./models/HumanResourceAnnualPlanningRequestModel"), exports);
323
+ var HumanResourceAnnualPlanningRequestModel_1 = require("./models/HumanResourceAnnualPlanningRequestModel");
324
+ Object.defineProperty(exports, "HumanResourceAnnualPlanningRequestStatus", { enumerable: true, get: function () { return HumanResourceAnnualPlanningRequestModel_1.HumanResourceAnnualPlanningRequestStatus; } });
325
+ Object.defineProperty(exports, "Quarter", { enumerable: true, get: function () { return HumanResourceAnnualPlanningRequestModel_1.Quarter; } });
326
+ __exportStar(require("./models/HumanResourceAnnualPlanningTaskModel"), exports);
327
+ var HumanResourceAnnualPlanningTaskModel_1 = require("./models/HumanResourceAnnualPlanningTaskModel");
328
+ Object.defineProperty(exports, "RepeatFrequency", { enumerable: true, get: function () { return HumanResourceAnnualPlanningTaskModel_1.RepeatFrequency; } });
329
+ Object.defineProperty(exports, "DurationUnit", { enumerable: true, get: function () { return HumanResourceAnnualPlanningTaskModel_1.DurationUnit; } });
@@ -0,0 +1,10 @@
1
+ import { BaseModel } from './BaseModel';
2
+ import { Departments } from './DepartmentsModel';
3
+ import { User } from './user';
4
+ export declare class DepartmentDocumentOwner extends BaseModel {
5
+ department_id: number;
6
+ user_id: number;
7
+ is_active: boolean;
8
+ department?: Departments;
9
+ user?: User;
10
+ }
@@ -0,0 +1,44 @@
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.DepartmentDocumentOwner = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ const DepartmentsModel_1 = require("./DepartmentsModel");
16
+ const user_1 = require("./user");
17
+ let DepartmentDocumentOwner = class DepartmentDocumentOwner extends BaseModel_1.BaseModel {
18
+ };
19
+ exports.DepartmentDocumentOwner = DepartmentDocumentOwner;
20
+ __decorate([
21
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false, unique: true }),
22
+ __metadata("design:type", Number)
23
+ ], DepartmentDocumentOwner.prototype, "department_id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
26
+ __metadata("design:type", Number)
27
+ ], DepartmentDocumentOwner.prototype, "user_id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: false, default: true }),
30
+ __metadata("design:type", Boolean)
31
+ ], DepartmentDocumentOwner.prototype, "is_active", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.ManyToOne)(() => DepartmentsModel_1.Departments),
34
+ (0, typeorm_1.JoinColumn)({ name: 'department_id' }),
35
+ __metadata("design:type", DepartmentsModel_1.Departments)
36
+ ], DepartmentDocumentOwner.prototype, "department", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.ManyToOne)(() => user_1.User),
39
+ (0, typeorm_1.JoinColumn)({ name: 'user_id' }),
40
+ __metadata("design:type", user_1.User)
41
+ ], DepartmentDocumentOwner.prototype, "user", void 0);
42
+ exports.DepartmentDocumentOwner = DepartmentDocumentOwner = __decorate([
43
+ (0, typeorm_1.Entity)({ name: 'department_document_owners' })
44
+ ], DepartmentDocumentOwner);
@@ -0,0 +1,13 @@
1
+ import { BaseModel } from './BaseModel';
2
+ import { User } from './user';
3
+ import { Document } from './DocumentModel';
4
+ export declare class DocumentAuditLog extends BaseModel {
5
+ document_id: number;
6
+ user_id: number;
7
+ action_type: string;
8
+ action_details?: any;
9
+ ip_address?: string;
10
+ user_agent?: string;
11
+ document?: Document;
12
+ user?: User;
13
+ }
@@ -0,0 +1,60 @@
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.DocumentAuditLog = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ const user_1 = require("./user");
16
+ const DocumentModel_1 = require("./DocumentModel");
17
+ let DocumentAuditLog = class DocumentAuditLog extends BaseModel_1.BaseModel {
18
+ };
19
+ exports.DocumentAuditLog = DocumentAuditLog;
20
+ __decorate([
21
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
22
+ __metadata("design:type", Number)
23
+ ], DocumentAuditLog.prototype, "document_id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
26
+ __metadata("design:type", Number)
27
+ ], DocumentAuditLog.prototype, "user_id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({
30
+ type: 'varchar',
31
+ length: 50,
32
+ nullable: false
33
+ }),
34
+ __metadata("design:type", String)
35
+ ], DocumentAuditLog.prototype, "action_type", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
38
+ __metadata("design:type", Object)
39
+ ], DocumentAuditLog.prototype, "action_details", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ type: 'varchar', length: 45, nullable: true }),
42
+ __metadata("design:type", String)
43
+ ], DocumentAuditLog.prototype, "ip_address", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
46
+ __metadata("design:type", String)
47
+ ], DocumentAuditLog.prototype, "user_agent", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.ManyToOne)(() => DocumentModel_1.Document),
50
+ (0, typeorm_1.JoinColumn)({ name: 'document_id' }),
51
+ __metadata("design:type", DocumentModel_1.Document)
52
+ ], DocumentAuditLog.prototype, "document", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.ManyToOne)(() => user_1.User),
55
+ (0, typeorm_1.JoinColumn)({ name: 'user_id' }),
56
+ __metadata("design:type", user_1.User)
57
+ ], DocumentAuditLog.prototype, "user", void 0);
58
+ exports.DocumentAuditLog = DocumentAuditLog = __decorate([
59
+ (0, typeorm_1.Entity)({ name: 'document_audit_logs' })
60
+ ], DocumentAuditLog);
@@ -0,0 +1,14 @@
1
+ import { BaseModel } from './BaseModel';
2
+ import { Departments } from './DepartmentsModel';
3
+ import { Document } from './DocumentModel';
4
+ export declare class DocumentFolder extends BaseModel {
5
+ name: string;
6
+ department_id: number;
7
+ parent_folder_id?: number;
8
+ description?: string;
9
+ is_active: boolean;
10
+ department?: Departments;
11
+ parentFolder?: DocumentFolder;
12
+ subFolders?: DocumentFolder[];
13
+ documents?: Document[];
14
+ }
@@ -0,0 +1,60 @@
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.DocumentFolder = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ const DepartmentsModel_1 = require("./DepartmentsModel");
16
+ const DocumentModel_1 = require("./DocumentModel");
17
+ let DocumentFolder = class DocumentFolder extends BaseModel_1.BaseModel {
18
+ };
19
+ exports.DocumentFolder = DocumentFolder;
20
+ __decorate([
21
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: false }),
22
+ __metadata("design:type", String)
23
+ ], DocumentFolder.prototype, "name", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
26
+ __metadata("design:type", Number)
27
+ ], DocumentFolder.prototype, "department_id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
30
+ __metadata("design:type", Number)
31
+ ], DocumentFolder.prototype, "parent_folder_id", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
34
+ __metadata("design:type", String)
35
+ ], DocumentFolder.prototype, "description", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: false, default: true }),
38
+ __metadata("design:type", Boolean)
39
+ ], DocumentFolder.prototype, "is_active", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.ManyToOne)(() => DepartmentsModel_1.Departments),
42
+ (0, typeorm_1.JoinColumn)({ name: 'department_id' }),
43
+ __metadata("design:type", DepartmentsModel_1.Departments)
44
+ ], DocumentFolder.prototype, "department", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.ManyToOne)(() => DocumentFolder, { nullable: true }),
47
+ (0, typeorm_1.JoinColumn)({ name: 'parent_folder_id' }),
48
+ __metadata("design:type", DocumentFolder)
49
+ ], DocumentFolder.prototype, "parentFolder", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.OneToMany)(() => DocumentFolder, folder => folder.parentFolder),
52
+ __metadata("design:type", Array)
53
+ ], DocumentFolder.prototype, "subFolders", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.OneToMany)(() => DocumentModel_1.Document, document => document.folder),
56
+ __metadata("design:type", Array)
57
+ ], DocumentFolder.prototype, "documents", void 0);
58
+ exports.DocumentFolder = DocumentFolder = __decorate([
59
+ (0, typeorm_1.Entity)({ name: 'document_folders' })
60
+ ], DocumentFolder);
@@ -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,25 @@
1
+ import { BaseModel } from './BaseModel';
2
+ import { Departments } from './DepartmentsModel';
3
+ import { DocumentFolder } from './DocumentFolderModel';
4
+ import { DocumentType } from './DocumentTypeModel';
5
+ import { DocumentPermission } from './DocumentPermissionModel';
6
+ import { DocumentAuditLog } from './DocumentAuditLogModel';
7
+ export declare class Document extends BaseModel {
8
+ title: string;
9
+ department_id: number;
10
+ document_type_id: number;
11
+ folder_id?: number;
12
+ mongodb_file_id: string;
13
+ file_name: string;
14
+ file_size: number;
15
+ file_type?: string;
16
+ version: number;
17
+ description?: string;
18
+ is_sensitive: boolean;
19
+ is_active: boolean;
20
+ department?: Departments;
21
+ documentType?: DocumentType;
22
+ folder?: DocumentFolder;
23
+ permissions?: DocumentPermission[];
24
+ auditLogs?: DocumentAuditLog[];
25
+ }
@@ -0,0 +1,96 @@
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.Document = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ const DepartmentsModel_1 = require("./DepartmentsModel");
16
+ const DocumentFolderModel_1 = require("./DocumentFolderModel");
17
+ const DocumentTypeModel_1 = require("./DocumentTypeModel");
18
+ const DocumentPermissionModel_1 = require("./DocumentPermissionModel");
19
+ const DocumentAuditLogModel_1 = require("./DocumentAuditLogModel");
20
+ let Document = class Document extends BaseModel_1.BaseModel {
21
+ };
22
+ exports.Document = Document;
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: false }),
25
+ __metadata("design:type", String)
26
+ ], Document.prototype, "title", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
29
+ __metadata("design:type", Number)
30
+ ], Document.prototype, "department_id", void 0);
31
+ __decorate([
32
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
33
+ __metadata("design:type", Number)
34
+ ], Document.prototype, "document_type_id", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
37
+ __metadata("design:type", Number)
38
+ ], Document.prototype, "folder_id", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
41
+ __metadata("design:type", String)
42
+ ], Document.prototype, "mongodb_file_id", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
45
+ __metadata("design:type", String)
46
+ ], Document.prototype, "file_name", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({ type: 'bigint', nullable: false }),
49
+ __metadata("design:type", Number)
50
+ ], Document.prototype, "file_size", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
53
+ __metadata("design:type", String)
54
+ ], Document.prototype, "file_type", void 0);
55
+ __decorate([
56
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false, default: 1 }),
57
+ __metadata("design:type", Number)
58
+ ], Document.prototype, "version", void 0);
59
+ __decorate([
60
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
61
+ __metadata("design:type", String)
62
+ ], Document.prototype, "description", void 0);
63
+ __decorate([
64
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: false, default: false }),
65
+ __metadata("design:type", Boolean)
66
+ ], Document.prototype, "is_sensitive", void 0);
67
+ __decorate([
68
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: false, default: true }),
69
+ __metadata("design:type", Boolean)
70
+ ], Document.prototype, "is_active", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.ManyToOne)(() => DepartmentsModel_1.Departments),
73
+ (0, typeorm_1.JoinColumn)({ name: 'department_id' }),
74
+ __metadata("design:type", DepartmentsModel_1.Departments)
75
+ ], Document.prototype, "department", void 0);
76
+ __decorate([
77
+ (0, typeorm_1.ManyToOne)(() => DocumentTypeModel_1.DocumentType),
78
+ (0, typeorm_1.JoinColumn)({ name: 'document_type_id' }),
79
+ __metadata("design:type", DocumentTypeModel_1.DocumentType)
80
+ ], Document.prototype, "documentType", void 0);
81
+ __decorate([
82
+ (0, typeorm_1.ManyToOne)(() => DocumentFolderModel_1.DocumentFolder, { nullable: true }),
83
+ (0, typeorm_1.JoinColumn)({ name: 'folder_id' }),
84
+ __metadata("design:type", DocumentFolderModel_1.DocumentFolder)
85
+ ], Document.prototype, "folder", void 0);
86
+ __decorate([
87
+ (0, typeorm_1.OneToMany)(() => DocumentPermissionModel_1.DocumentPermission, permission => permission.document),
88
+ __metadata("design:type", Array)
89
+ ], Document.prototype, "permissions", void 0);
90
+ __decorate([
91
+ (0, typeorm_1.OneToMany)(() => DocumentAuditLogModel_1.DocumentAuditLog, log => log.document),
92
+ __metadata("design:type", Array)
93
+ ], Document.prototype, "auditLogs", void 0);
94
+ exports.Document = Document = __decorate([
95
+ (0, typeorm_1.Entity)({ name: 'documents' })
96
+ ], Document);