@platform-modules/civil-aviation-authority 2.3.183 → 2.3.185

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 (71) hide show
  1. package/.env +9 -17
  2. package/dist/data-source.js +5 -1
  3. package/dist/index.d.ts +3 -1
  4. package/dist/index.js +3 -2
  5. package/dist/models/ITApprovalSettings.d.ts +7 -0
  6. package/dist/models/ITApprovalSettings.js +40 -0
  7. package/dist/models/ITServicesTypesMuscatModel.d.ts +6 -0
  8. package/dist/models/ITServicesTypesMuscatModel.js +34 -0
  9. package/dist/models/ITServicesTypesSalalahModel.d.ts +6 -0
  10. package/dist/models/ITServicesTypesSalalahModel.js +34 -0
  11. package/dist/models/RequestATenderRequestModel.d.ts +37 -0
  12. package/dist/models/RequestATenderRequestModel.js +143 -0
  13. package/dist/models/RequestTenderAnalysisRequestModel.d.ts +22 -0
  14. package/dist/models/RequestTenderAnalysisRequestModel.js +98 -0
  15. package/dist/models/RespondToEnquiriesRequestModel.d.ts +1 -7
  16. package/dist/models/RespondToEnquiriesRequestModel.js +3 -20
  17. package/dist/models/Workflows.d.ts +9 -0
  18. package/dist/models/Workflows.js +31 -0
  19. package/package.json +24 -24
  20. package/src/data-source.ts +5 -1
  21. package/src/index.ts +414 -413
  22. package/src/models/AccommodationApprovalModel.ts +8 -8
  23. package/src/models/AccommodationRequestModel.ts +8 -8
  24. package/src/models/AirportEntryPermitModel.ts +276 -276
  25. package/src/models/AnnualIncrementRequestEmployeeModel.ts +65 -65
  26. package/src/models/AnnualIncrementRequestModel.ts +25 -25
  27. package/src/models/AnnualTrainingPlanRequestModel.ts +153 -153
  28. package/src/models/AppealAgainstAdministrativeDecisionRequestModel.ts +23 -23
  29. package/src/models/CAAServices.ts +33 -33
  30. package/src/models/CAASubServices.ts +33 -33
  31. package/src/models/CAIRatingMasterModel.ts +39 -39
  32. package/src/models/CSRMBusinessImpactRatingMasterModel.ts +25 -25
  33. package/src/models/CSRMLikelihoodMasterModel.ts +25 -25
  34. package/src/models/CashAllowanceLeaveRequestModel.ts +11 -11
  35. package/src/models/DepartmentsModel.ts +25 -25
  36. package/src/models/DocumentDriveModel.ts +28 -28
  37. package/src/models/DocumentFolderModel.ts +45 -45
  38. package/src/models/HousingContractCancelChatModel.ts +56 -56
  39. package/src/models/HousingContractRenewalChatModel.ts +59 -59
  40. package/src/models/HrServiceRequestModel.ts +193 -193
  41. package/src/models/ITRequestAttachmentModel.ts +73 -73
  42. package/src/models/ITRequestChatModel.ts +74 -74
  43. package/src/models/ItApprovalsModel.ts +84 -84
  44. package/src/models/ItWorkflowModel.ts +55 -55
  45. package/src/models/MissionTravelPassportExpiryNotificationConfigModel.ts +36 -36
  46. package/src/models/PerformanceCyclePeriodModel.ts +26 -26
  47. package/src/models/PerformanceGoalMasterModel.ts +27 -27
  48. package/src/models/PerformanceManagementRequestGoalModel.ts +46 -46
  49. package/src/models/PerformanceManagementRequestModel.ts +14 -14
  50. package/src/models/PromotionRequestModel.ts +11 -11
  51. package/src/models/RequestATenderRequestModel.ts +102 -0
  52. package/src/models/RequestTenderAnalysisRequestModel.ts +65 -0
  53. package/src/models/ResidentialUnitRentalChatModel.ts +56 -56
  54. package/src/models/ResidentialUnitRentalRequestModel.ts +218 -218
  55. package/src/models/RespondToEnquiriesRequestModel.ts +31 -48
  56. package/src/models/ServicesNotificationConfigModel.ts +55 -55
  57. package/src/models/StudyLeaveRequestModel.ts +144 -144
  58. package/src/models/TrainingRequestModel.ts +164 -164
  59. package/src/models/TrainingRoomBookingRequestModel.ts +142 -142
  60. package/src/models/TrainingRoomNotificationConfigModel.ts +30 -30
  61. package/src/models/UserSkillModel.ts +56 -56
  62. package/dist/models/DocumentMetadataModel.d.ts +0 -45
  63. package/dist/models/DocumentMetadataModel.js +0 -171
  64. package/dist/models/DocumentationDepartmentsModel.d.ts +0 -13
  65. package/dist/models/DocumentationDepartmentsModel.js +0 -53
  66. package/dist/models/FolderModel.d.ts +0 -16
  67. package/dist/models/FolderModel.js +0 -85
  68. package/dist/models/PermissionModel.d.ts +0 -18
  69. package/dist/models/PermissionModel.js +0 -68
  70. package/dist/models/UUIDBaseModel.d.ts +0 -14
  71. package/dist/models/UUIDBaseModel.js +0 -66
@@ -1,142 +1,142 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from "./BaseModel";
3
-
4
- export enum TrainingRoomBookingRequestStatus {
5
- PENDING = "Pending",
6
- IN_PROGRESS = "In Progress",
7
- COMPLETED = "Completed",
8
- APPROVED = "Approved",
9
- REJECTED = "Rejected"
10
- }
11
-
12
- export enum TrainingRoomBookingRoomType {
13
- TRAINING_ROOMS_A = "Training Rooms (A1, A2)",
14
- TRAINING_ROOMS_B = "Training Rooms (B1, B2)",
15
- TRAINING_ROOMS_C = "Training Rooms (C1, C2)",
16
- TRAINING_ROOMS_D = "Training Rooms (D1, D2)",
17
- LECTURE_HALL = "Lecture Hall",
18
- LABORATORY = "Laboratory"
19
- }
20
-
21
- @Entity({ name: "training_room_booking_requests" })
22
- export class TrainingRoomBookingRequest extends BaseModel {
23
- @Column({ type: "integer", nullable: true })
24
- req_user_department_id: number | null;
25
-
26
- @Column({ type: "integer", nullable: true })
27
- req_user_section_id: number | null;
28
-
29
- @Column({ type: "integer", nullable: true })
30
- req_user_position_id: number | null;
31
-
32
- @Column({ type: "integer", nullable: true })
33
- service_id: number | null;
34
-
35
- @Column({ type: "integer", nullable: true })
36
- sub_service_id: number | null;
37
-
38
- @Column({ type: "integer", nullable: false })
39
- user_id: number;
40
-
41
- @Column({ type: "text", nullable: false })
42
- purpose_of_training: string;
43
-
44
- @Column({ type: "date", nullable: false })
45
- date_of_event: Date;
46
-
47
- @Column({ type: "time", nullable: false })
48
- start_time: string;
49
-
50
- @Column({ type: "time", nullable: false })
51
- end_time: string;
52
-
53
- @Column({
54
- type: "enum",
55
- enum: TrainingRoomBookingRoomType,
56
- nullable: false
57
- })
58
- room_type: TrainingRoomBookingRoomType;
59
-
60
- @Column({ type: "boolean", default: false, nullable: false })
61
- network_support_required: boolean;
62
-
63
- @Column({ type: "boolean", default: false, nullable: false })
64
- meals_required: boolean;
65
-
66
- @Column({ type: "integer", nullable: false })
67
- number_of_attendees: number;
68
-
69
- @Column({ type: "json", nullable: true })
70
- name_of_participants: string[] | null;
71
-
72
- @Column({ type: "text", nullable: true })
73
- remarks: string | null;
74
-
75
- @Column({
76
- type: "enum",
77
- enum: TrainingRoomBookingRequestStatus,
78
- default: TrainingRoomBookingRequestStatus.PENDING,
79
- nullable: false
80
- })
81
- status: TrainingRoomBookingRequestStatus;
82
-
83
- @Column({ type: "integer", nullable: true })
84
- reviewer_user_id: number | null;
85
-
86
- @Column({ type: "integer", nullable: true })
87
- assigned_to_user_id: number | null;
88
-
89
- @Column({ type: "timestamp", nullable: true })
90
- assigned_at: Date | null;
91
-
92
- @Column({ type: "varchar", length: 255, nullable: true })
93
- workflow_execution_id: string | null;
94
-
95
- constructor(
96
- user_id: number,
97
- purpose_of_training: string,
98
- date_of_event: Date,
99
- start_time: string,
100
- end_time: string,
101
- room_type: TrainingRoomBookingRoomType,
102
- number_of_attendees: number,
103
- network_support_required: boolean = false,
104
- meals_required: boolean = false,
105
- status: TrainingRoomBookingRequestStatus = TrainingRoomBookingRequestStatus.PENDING,
106
- service_id?: number | null,
107
- sub_service_id?: number | null,
108
- req_user_department_id?: number | null,
109
- req_user_section_id?: number | null,
110
- req_user_position_id?: number | null,
111
- name_of_participants?: string[] | null,
112
- remarks?: string | null,
113
- reviewer_user_id?: number | null,
114
- assigned_to_user_id?: number | null,
115
- assigned_at?: Date | null,
116
- workflow_execution_id?: string | null
117
- ) {
118
- super();
119
- this.user_id = user_id;
120
- this.purpose_of_training = purpose_of_training;
121
- this.date_of_event = date_of_event;
122
- this.start_time = start_time;
123
- this.end_time = end_time;
124
- this.room_type = room_type;
125
- this.number_of_attendees = number_of_attendees;
126
- this.network_support_required = network_support_required;
127
- this.meals_required = meals_required;
128
- this.status = status;
129
- this.service_id = service_id || null;
130
- this.sub_service_id = sub_service_id || null;
131
- this.req_user_department_id = req_user_department_id || null;
132
- this.req_user_section_id = req_user_section_id || null;
133
- this.req_user_position_id = req_user_position_id || null;
134
- this.name_of_participants = name_of_participants ?? null;
135
- this.remarks = remarks || null;
136
- this.reviewer_user_id = reviewer_user_id || null;
137
- this.assigned_to_user_id = assigned_to_user_id || null;
138
- this.assigned_at = assigned_at || null;
139
- this.workflow_execution_id = workflow_execution_id || null;
140
- }
141
- }
142
-
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+
4
+ export enum TrainingRoomBookingRequestStatus {
5
+ PENDING = "Pending",
6
+ IN_PROGRESS = "In Progress",
7
+ COMPLETED = "Completed",
8
+ APPROVED = "Approved",
9
+ REJECTED = "Rejected"
10
+ }
11
+
12
+ export enum TrainingRoomBookingRoomType {
13
+ TRAINING_ROOMS_A = "Training Rooms (A1, A2)",
14
+ TRAINING_ROOMS_B = "Training Rooms (B1, B2)",
15
+ TRAINING_ROOMS_C = "Training Rooms (C1, C2)",
16
+ TRAINING_ROOMS_D = "Training Rooms (D1, D2)",
17
+ LECTURE_HALL = "Lecture Hall",
18
+ LABORATORY = "Laboratory"
19
+ }
20
+
21
+ @Entity({ name: "training_room_booking_requests" })
22
+ export class TrainingRoomBookingRequest extends BaseModel {
23
+ @Column({ type: "integer", nullable: true })
24
+ req_user_department_id: number | null;
25
+
26
+ @Column({ type: "integer", nullable: true })
27
+ req_user_section_id: number | null;
28
+
29
+ @Column({ type: "integer", nullable: true })
30
+ req_user_position_id: number | null;
31
+
32
+ @Column({ type: "integer", nullable: true })
33
+ service_id: number | null;
34
+
35
+ @Column({ type: "integer", nullable: true })
36
+ sub_service_id: number | null;
37
+
38
+ @Column({ type: "integer", nullable: false })
39
+ user_id: number;
40
+
41
+ @Column({ type: "text", nullable: false })
42
+ purpose_of_training: string;
43
+
44
+ @Column({ type: "date", nullable: false })
45
+ date_of_event: Date;
46
+
47
+ @Column({ type: "time", nullable: false })
48
+ start_time: string;
49
+
50
+ @Column({ type: "time", nullable: false })
51
+ end_time: string;
52
+
53
+ @Column({
54
+ type: "enum",
55
+ enum: TrainingRoomBookingRoomType,
56
+ nullable: false
57
+ })
58
+ room_type: TrainingRoomBookingRoomType;
59
+
60
+ @Column({ type: "boolean", default: false, nullable: false })
61
+ network_support_required: boolean;
62
+
63
+ @Column({ type: "boolean", default: false, nullable: false })
64
+ meals_required: boolean;
65
+
66
+ @Column({ type: "integer", nullable: false })
67
+ number_of_attendees: number;
68
+
69
+ @Column({ type: "json", nullable: true })
70
+ name_of_participants: string[] | null;
71
+
72
+ @Column({ type: "text", nullable: true })
73
+ remarks: string | null;
74
+
75
+ @Column({
76
+ type: "enum",
77
+ enum: TrainingRoomBookingRequestStatus,
78
+ default: TrainingRoomBookingRequestStatus.PENDING,
79
+ nullable: false
80
+ })
81
+ status: TrainingRoomBookingRequestStatus;
82
+
83
+ @Column({ type: "integer", nullable: true })
84
+ reviewer_user_id: number | null;
85
+
86
+ @Column({ type: "integer", nullable: true })
87
+ assigned_to_user_id: number | null;
88
+
89
+ @Column({ type: "timestamp", nullable: true })
90
+ assigned_at: Date | null;
91
+
92
+ @Column({ type: "varchar", length: 255, nullable: true })
93
+ workflow_execution_id: string | null;
94
+
95
+ constructor(
96
+ user_id: number,
97
+ purpose_of_training: string,
98
+ date_of_event: Date,
99
+ start_time: string,
100
+ end_time: string,
101
+ room_type: TrainingRoomBookingRoomType,
102
+ number_of_attendees: number,
103
+ network_support_required: boolean = false,
104
+ meals_required: boolean = false,
105
+ status: TrainingRoomBookingRequestStatus = TrainingRoomBookingRequestStatus.PENDING,
106
+ service_id?: number | null,
107
+ sub_service_id?: number | null,
108
+ req_user_department_id?: number | null,
109
+ req_user_section_id?: number | null,
110
+ req_user_position_id?: number | null,
111
+ name_of_participants?: string[] | null,
112
+ remarks?: string | null,
113
+ reviewer_user_id?: number | null,
114
+ assigned_to_user_id?: number | null,
115
+ assigned_at?: Date | null,
116
+ workflow_execution_id?: string | null
117
+ ) {
118
+ super();
119
+ this.user_id = user_id;
120
+ this.purpose_of_training = purpose_of_training;
121
+ this.date_of_event = date_of_event;
122
+ this.start_time = start_time;
123
+ this.end_time = end_time;
124
+ this.room_type = room_type;
125
+ this.number_of_attendees = number_of_attendees;
126
+ this.network_support_required = network_support_required;
127
+ this.meals_required = meals_required;
128
+ this.status = status;
129
+ this.service_id = service_id || null;
130
+ this.sub_service_id = sub_service_id || null;
131
+ this.req_user_department_id = req_user_department_id || null;
132
+ this.req_user_section_id = req_user_section_id || null;
133
+ this.req_user_position_id = req_user_position_id || null;
134
+ this.name_of_participants = name_of_participants ?? null;
135
+ this.remarks = remarks || null;
136
+ this.reviewer_user_id = reviewer_user_id || null;
137
+ this.assigned_to_user_id = assigned_to_user_id || null;
138
+ this.assigned_at = assigned_at || null;
139
+ this.workflow_execution_id = workflow_execution_id || null;
140
+ }
141
+ }
142
+
@@ -1,30 +1,30 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from "./BaseModel";
3
-
4
- export enum NotificationFrequency {
5
- YEARLY = "yearly",
6
- SIX_MONTHS_BEFORE = "6_months_before"
7
- }
8
-
9
- @Entity({ name: "training_room_notification_configs" })
10
- export class TrainingRoomNotificationConfig extends BaseModel {
11
- @Column({ type: "integer", nullable: false })
12
- department_id: number;
13
-
14
- @Column({ type: "integer", nullable: true })
15
- section_id: number | null;
16
-
17
- @Column({ type: "boolean", nullable: false, default: true })
18
- is_active: boolean;
19
-
20
- constructor(
21
- department_id: number,
22
- section_id: number | null = null,
23
- is_active: boolean = true
24
- ) {
25
- super();
26
- this.department_id = department_id;
27
- this.section_id = section_id;
28
- this.is_active = is_active;
29
- }
30
- }
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+
4
+ export enum NotificationFrequency {
5
+ YEARLY = "yearly",
6
+ SIX_MONTHS_BEFORE = "6_months_before"
7
+ }
8
+
9
+ @Entity({ name: "training_room_notification_configs" })
10
+ export class TrainingRoomNotificationConfig extends BaseModel {
11
+ @Column({ type: "integer", nullable: false })
12
+ department_id: number;
13
+
14
+ @Column({ type: "integer", nullable: true })
15
+ section_id: number | null;
16
+
17
+ @Column({ type: "boolean", nullable: false, default: true })
18
+ is_active: boolean;
19
+
20
+ constructor(
21
+ department_id: number,
22
+ section_id: number | null = null,
23
+ is_active: boolean = true
24
+ ) {
25
+ super();
26
+ this.department_id = department_id;
27
+ this.section_id = section_id;
28
+ this.is_active = is_active;
29
+ }
30
+ }
@@ -1,56 +1,56 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from "./BaseModel";
3
- import { SkillCategory } from "./SkillsEnhancementRequestModel";
4
-
5
- @Entity({ name: "user_skills" })
6
- export class UserSkill extends BaseModel {
7
- @Column({ type: "integer", nullable: false })
8
- user_id: number;
9
-
10
- @Column({ type: "varchar", length: 255, nullable: false })
11
- skill_name: string;
12
-
13
- @Column({ type: "enum", enum: SkillCategory, nullable: true })
14
- skill_category: SkillCategory | null;
15
-
16
- @Column({ type: "varchar", length: 255, nullable: true })
17
- issuing_authority: string | null;
18
-
19
- @Column({ type: "date", nullable: true })
20
- completion_date: Date | null;
21
-
22
- @Column({ type: "text", nullable: true })
23
- skill_summary: string | null;
24
-
25
- @Column({ type: "integer", nullable: true })
26
- source_request_id: number | null;
27
-
28
- @Column({ type: "varchar", length: 50, nullable: true })
29
- source_request_type: string | null;
30
-
31
- @Column({ type: "boolean", nullable: false, default: true })
32
- is_active: boolean;
33
-
34
- constructor(
35
- user_id: number,
36
- skill_name: string,
37
- skill_category?: SkillCategory | null,
38
- issuing_authority?: string | null,
39
- completion_date?: Date | null,
40
- skill_summary?: string | null,
41
- source_request_id?: number | null,
42
- source_request_type?: string | null,
43
- is_active?: boolean
44
- ) {
45
- super();
46
- this.user_id = user_id;
47
- this.skill_name = skill_name;
48
- this.skill_category = skill_category || null;
49
- this.issuing_authority = issuing_authority || null;
50
- this.completion_date = completion_date || null;
51
- this.skill_summary = skill_summary || null;
52
- this.source_request_id = source_request_id || null;
53
- this.source_request_type = source_request_type || null;
54
- this.is_active = is_active !== undefined ? is_active : true;
55
- }
56
- }
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+ import { SkillCategory } from "./SkillsEnhancementRequestModel";
4
+
5
+ @Entity({ name: "user_skills" })
6
+ export class UserSkill extends BaseModel {
7
+ @Column({ type: "integer", nullable: false })
8
+ user_id: number;
9
+
10
+ @Column({ type: "varchar", length: 255, nullable: false })
11
+ skill_name: string;
12
+
13
+ @Column({ type: "enum", enum: SkillCategory, nullable: true })
14
+ skill_category: SkillCategory | null;
15
+
16
+ @Column({ type: "varchar", length: 255, nullable: true })
17
+ issuing_authority: string | null;
18
+
19
+ @Column({ type: "date", nullable: true })
20
+ completion_date: Date | null;
21
+
22
+ @Column({ type: "text", nullable: true })
23
+ skill_summary: string | null;
24
+
25
+ @Column({ type: "integer", nullable: true })
26
+ source_request_id: number | null;
27
+
28
+ @Column({ type: "varchar", length: 50, nullable: true })
29
+ source_request_type: string | null;
30
+
31
+ @Column({ type: "boolean", nullable: false, default: true })
32
+ is_active: boolean;
33
+
34
+ constructor(
35
+ user_id: number,
36
+ skill_name: string,
37
+ skill_category?: SkillCategory | null,
38
+ issuing_authority?: string | null,
39
+ completion_date?: Date | null,
40
+ skill_summary?: string | null,
41
+ source_request_id?: number | null,
42
+ source_request_type?: string | null,
43
+ is_active?: boolean
44
+ ) {
45
+ super();
46
+ this.user_id = user_id;
47
+ this.skill_name = skill_name;
48
+ this.skill_category = skill_category || null;
49
+ this.issuing_authority = issuing_authority || null;
50
+ this.completion_date = completion_date || null;
51
+ this.skill_summary = skill_summary || null;
52
+ this.source_request_id = source_request_id || null;
53
+ this.source_request_type = source_request_type || null;
54
+ this.is_active = is_active !== undefined ? is_active : true;
55
+ }
56
+ }
@@ -1,45 +0,0 @@
1
- import { Departments } from './DepartmentsModel';
2
- import { UUIDBaseModel } from './UUIDBaseModel';
3
- export declare enum DocumentType {
4
- POLICY = "policy",
5
- PROCEDURE = "procedure",
6
- MANUAL = "manual",
7
- TEMPLATE = "template",
8
- REPORT = "report"
9
- }
10
- export declare enum DocumentStatus {
11
- ACTIVE = "active",
12
- ARCHIVED = "archived",
13
- DRAFT = "draft"
14
- }
15
- export declare enum AccessLevel {
16
- GENERAL = "general",
17
- RESTRICTED = "restricted"
18
- }
19
- export declare class DocumentMetadata extends UUIDBaseModel {
20
- title: string;
21
- description?: string;
22
- original_name: string;
23
- mime_type: string;
24
- size: number;
25
- mongodb_file_id: string;
26
- document_type: DocumentType;
27
- access_level: AccessLevel;
28
- status: DocumentStatus;
29
- version: string;
30
- tags: string[];
31
- is_sensitive: boolean;
32
- department: Departments;
33
- department_id: number;
34
- folder_id?: string | null;
35
- folder_path: string;
36
- uploaded_by: string;
37
- uploaded_by_name?: string;
38
- authorized_person?: string;
39
- allowed_roles: string[];
40
- allowed_users: string[];
41
- download_count: number;
42
- last_accessed_at?: Date;
43
- metadata?: Record<string, any>;
44
- constructor(title: string, original_name: string, mime_type: string, size: number, mongodb_file_id: string, document_type: DocumentType, department_id: number, uploaded_by: string, access_level?: AccessLevel, status?: DocumentStatus, version?: string, folder_path?: string, created_by?: string, description?: string, folder_id?: string | null, uploaded_by_name?: string, authorized_person?: string, tags?: string[], allowed_roles?: string[], allowed_users?: string[], is_sensitive?: boolean, download_count?: number, last_accessed_at?: Date, metadata?: Record<string, any>);
45
- }
@@ -1,171 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.DocumentMetadata = exports.AccessLevel = exports.DocumentStatus = exports.DocumentType = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const DepartmentsModel_1 = require("./DepartmentsModel");
15
- const UUIDBaseModel_1 = require("./UUIDBaseModel");
16
- var DocumentType;
17
- (function (DocumentType) {
18
- DocumentType["POLICY"] = "policy";
19
- DocumentType["PROCEDURE"] = "procedure";
20
- DocumentType["MANUAL"] = "manual";
21
- DocumentType["TEMPLATE"] = "template";
22
- DocumentType["REPORT"] = "report";
23
- })(DocumentType || (exports.DocumentType = DocumentType = {}));
24
- var DocumentStatus;
25
- (function (DocumentStatus) {
26
- DocumentStatus["ACTIVE"] = "active";
27
- DocumentStatus["ARCHIVED"] = "archived";
28
- DocumentStatus["DRAFT"] = "draft";
29
- })(DocumentStatus || (exports.DocumentStatus = DocumentStatus = {}));
30
- var AccessLevel;
31
- (function (AccessLevel) {
32
- AccessLevel["GENERAL"] = "general";
33
- AccessLevel["RESTRICTED"] = "restricted";
34
- })(AccessLevel || (exports.AccessLevel = AccessLevel = {}));
35
- let DocumentMetadata = class DocumentMetadata extends UUIDBaseModel_1.UUIDBaseModel {
36
- constructor(title, original_name, mime_type, size, mongodb_file_id, document_type, department_id, uploaded_by, access_level = AccessLevel.GENERAL, status = DocumentStatus.ACTIVE, version = '1.0.0', folder_path = '/', created_by, description, folder_id, uploaded_by_name, authorized_person, tags, allowed_roles, allowed_users, is_sensitive = false, download_count = 0, last_accessed_at, metadata) {
37
- super();
38
- this.title = title;
39
- this.original_name = original_name;
40
- this.mime_type = mime_type;
41
- this.size = size;
42
- this.mongodb_file_id = mongodb_file_id;
43
- this.document_type = document_type;
44
- this.department_id = department_id;
45
- this.uploaded_by = uploaded_by;
46
- this.access_level = access_level;
47
- this.status = status;
48
- this.version = version;
49
- this.folder_path = folder_path;
50
- this.description = description;
51
- this.folder_id = folder_id;
52
- this.uploaded_by_name = uploaded_by_name;
53
- this.authorized_person = authorized_person;
54
- this.tags = tags || [];
55
- this.allowed_roles = allowed_roles || [];
56
- this.allowed_users = allowed_users || [];
57
- this.is_sensitive = is_sensitive;
58
- this.download_count = download_count;
59
- this.last_accessed_at = last_accessed_at;
60
- this.metadata = metadata;
61
- if (created_by) {
62
- this.created_by = created_by;
63
- }
64
- }
65
- };
66
- exports.DocumentMetadata = DocumentMetadata;
67
- __decorate([
68
- (0, typeorm_1.Column)({ type: 'varchar', length: 500 }),
69
- (0, typeorm_1.Index)(),
70
- __metadata("design:type", String)
71
- ], DocumentMetadata.prototype, "title", void 0);
72
- __decorate([
73
- (0, typeorm_1.Column)({ type: 'text', nullable: true }),
74
- __metadata("design:type", String)
75
- ], DocumentMetadata.prototype, "description", void 0);
76
- __decorate([
77
- (0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
78
- __metadata("design:type", String)
79
- ], DocumentMetadata.prototype, "original_name", void 0);
80
- __decorate([
81
- (0, typeorm_1.Column)({ type: 'varchar', length: 100 }),
82
- __metadata("design:type", String)
83
- ], DocumentMetadata.prototype, "mime_type", void 0);
84
- __decorate([
85
- (0, typeorm_1.Column)({ type: 'bigint' }),
86
- __metadata("design:type", Number)
87
- ], DocumentMetadata.prototype, "size", void 0);
88
- __decorate([
89
- (0, typeorm_1.Column)({ type: 'varchar', length: 255, unique: true }),
90
- __metadata("design:type", String)
91
- ], DocumentMetadata.prototype, "mongodb_file_id", void 0);
92
- __decorate([
93
- (0, typeorm_1.Column)({ type: 'enum', enum: DocumentType }),
94
- (0, typeorm_1.Index)(),
95
- __metadata("design:type", String)
96
- ], DocumentMetadata.prototype, "document_type", void 0);
97
- __decorate([
98
- (0, typeorm_1.Column)({ type: 'enum', enum: AccessLevel, default: AccessLevel.GENERAL }),
99
- (0, typeorm_1.Index)(),
100
- __metadata("design:type", String)
101
- ], DocumentMetadata.prototype, "access_level", void 0);
102
- __decorate([
103
- (0, typeorm_1.Column)({ type: 'enum', enum: DocumentStatus, default: DocumentStatus.ACTIVE }),
104
- (0, typeorm_1.Index)(),
105
- __metadata("design:type", String)
106
- ], DocumentMetadata.prototype, "status", void 0);
107
- __decorate([
108
- (0, typeorm_1.Column)({ type: 'varchar', length: 50, default: '1.0.0' }),
109
- __metadata("design:type", String)
110
- ], DocumentMetadata.prototype, "version", void 0);
111
- __decorate([
112
- (0, typeorm_1.Column)({ type: 'text', array: true, default: [] }),
113
- __metadata("design:type", Array)
114
- ], DocumentMetadata.prototype, "tags", void 0);
115
- __decorate([
116
- (0, typeorm_1.Column)({ type: 'boolean', default: false }),
117
- __metadata("design:type", Boolean)
118
- ], DocumentMetadata.prototype, "is_sensitive", void 0);
119
- __decorate([
120
- (0, typeorm_1.ManyToOne)('Departments', { eager: true }),
121
- (0, typeorm_1.JoinColumn)({ name: 'department_id' }),
122
- __metadata("design:type", DepartmentsModel_1.Departments)
123
- ], DocumentMetadata.prototype, "department", void 0);
124
- __decorate([
125
- (0, typeorm_1.Column)({ type: 'integer' }),
126
- __metadata("design:type", Number)
127
- ], DocumentMetadata.prototype, "department_id", void 0);
128
- __decorate([
129
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
130
- __metadata("design:type", Object)
131
- ], DocumentMetadata.prototype, "folder_id", void 0);
132
- __decorate([
133
- (0, typeorm_1.Column)({ type: 'varchar', length: 500, default: '/' }),
134
- __metadata("design:type", String)
135
- ], DocumentMetadata.prototype, "folder_path", void 0);
136
- __decorate([
137
- (0, typeorm_1.Column)({ type: 'uuid' }),
138
- __metadata("design:type", String)
139
- ], DocumentMetadata.prototype, "uploaded_by", void 0);
140
- __decorate([
141
- (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
142
- __metadata("design:type", String)
143
- ], DocumentMetadata.prototype, "uploaded_by_name", void 0);
144
- __decorate([
145
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
146
- __metadata("design:type", String)
147
- ], DocumentMetadata.prototype, "authorized_person", void 0);
148
- __decorate([
149
- (0, typeorm_1.Column)({ type: 'text', array: true, default: [] }),
150
- __metadata("design:type", Array)
151
- ], DocumentMetadata.prototype, "allowed_roles", void 0);
152
- __decorate([
153
- (0, typeorm_1.Column)({ type: 'text', array: true, default: [] }),
154
- __metadata("design:type", Array)
155
- ], DocumentMetadata.prototype, "allowed_users", void 0);
156
- __decorate([
157
- (0, typeorm_1.Column)({ type: 'int', default: 0 }),
158
- __metadata("design:type", Number)
159
- ], DocumentMetadata.prototype, "download_count", void 0);
160
- __decorate([
161
- (0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
162
- __metadata("design:type", Date)
163
- ], DocumentMetadata.prototype, "last_accessed_at", void 0);
164
- __decorate([
165
- (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
166
- __metadata("design:type", Object)
167
- ], DocumentMetadata.prototype, "metadata", void 0);
168
- exports.DocumentMetadata = DocumentMetadata = __decorate([
169
- (0, typeorm_1.Entity)({ name: 'document_metadata' }),
170
- __metadata("design:paramtypes", [String, String, String, Number, String, String, Number, String, String, String, String, String, String, String, Object, String, String, Array, Array, Array, Boolean, Number, Date, Object])
171
- ], DocumentMetadata);