@platform-modules/civil-aviation-authority 2.3.333 → 2.3.335

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 (91) hide show
  1. package/dist/data-source.js +2 -0
  2. package/dist/helpers/cancellation-bilingual-persist.helper.d.ts +37 -0
  3. package/dist/helpers/cancellation-bilingual-persist.helper.js +77 -0
  4. package/dist/index.d.ts +1 -3
  5. package/dist/index.js +2 -3
  6. package/dist/models/AnnualPlanSubmissionRestrictionModel.d.ts +9 -0
  7. package/dist/models/AnnualPlanSubmissionRestrictionModel.js +47 -0
  8. package/dist/models/AnnualTrainingPlanRequestModel.d.ts +12 -21
  9. package/dist/models/AnnualTrainingPlanRequestModel.js +60 -75
  10. package/dist/models/CyberSecurityRiskManagementRiskModel.d.ts +4 -0
  11. package/dist/models/CyberSecurityRiskManagementRiskModel.js +16 -0
  12. package/dist/models/SlaApprovalsViewModel.js +54 -54
  13. package/package.json +1 -1
  14. package/scripts/sync-sla-reports-sql.js +92 -92
  15. package/sql/README.md +21 -21
  16. package/sql/add_csrm_risk_tracking_fields.sql +6 -0
  17. package/sql/add_training_request_reference_number.sql +9 -9
  18. package/sql/add_training_room_booking_records_reference.sql +19 -19
  19. package/sql/annual_training_plan_bulk_upload.sql +140 -140
  20. package/sql/annual_training_plan_department_plans.sql +80 -80
  21. package/sql/create_annual_plan_submission_restriction.sql +27 -0
  22. package/sql/sla_reports_admin_procedures.sql +322 -322
  23. package/sql/sla_reports_approvals_workbook.sql +427 -427
  24. package/sql/sla_reports_procedures.sql +883 -883
  25. package/sql/vw_sla_approvals.sql +115 -115
  26. package/sql/vw_sla_my_requests.sql +58 -58
  27. package/src/data-source.ts +2 -0
  28. package/src/index.ts +521 -518
  29. package/src/models/AccessCardRequestModel.ts +135 -135
  30. package/src/models/AirportEntryPermitModel.ts +276 -276
  31. package/src/models/AnnualPlanSubmissionRestrictionModel.ts +27 -0
  32. package/src/models/AnnualTrainingPlanDepartmentPlanDecisionModel.ts +33 -33
  33. package/src/models/AnnualTrainingPlanDepartmentPlanModel.ts +31 -31
  34. package/src/models/AnnualTrainingPlanItemModel.ts +71 -71
  35. package/src/models/AnnualTrainingPlanRequestModel.ts +156 -156
  36. package/src/models/CyberSecurityRiskManagementRiskModel.ts +12 -0
  37. package/src/models/DocumentDriveModel.ts +28 -28
  38. package/src/models/DocumentFolderModel.ts +45 -45
  39. package/src/models/HotelApprovalModel.ts +83 -83
  40. package/src/models/HousingContractCancelApprovalModel.ts +64 -64
  41. package/src/models/HousingContractRenewalApprovalModel.ts +64 -64
  42. package/src/models/ITRequestAttachmentModel.ts +73 -73
  43. package/src/models/ItApprovalsModel.ts +84 -84
  44. package/src/models/LegalConsultationApprovalModel.ts +65 -65
  45. package/src/models/MissionTravelPassportExpiryNotificationConfigModel.ts +36 -36
  46. package/src/models/NotificationModel.ts +89 -89
  47. package/src/models/ResidentialUnitRentalApprovalModel.ts +143 -143
  48. package/src/models/ServiceExtensionAfter60ApprovalModel.ts +87 -87
  49. package/src/models/ServiceSlaApprovalModel.ts +64 -64
  50. package/src/models/ServicesNotificationConfigModel.ts +55 -55
  51. package/src/models/SlaApprovalsViewModel.ts +142 -142
  52. package/src/models/StudyLeaveRequestModel.ts +173 -173
  53. package/src/models/TrainingRequestModel.ts +169 -169
  54. package/src/models/TrainingRoomBookingRequestModel.ts +178 -178
  55. package/src/models/TrainingRoomBookingWorkflowModel.ts +81 -81
  56. package/src/models/TrainingRoomNotificationConfigModel.ts +30 -30
  57. package/src/models/role.ts +34 -34
  58. package/src/scripts.ts +20 -20
  59. package/src/sla/sla-table-sync.service.ts +90 -90
  60. package/dist/models/AnnualTrainingPlanDepartmentPlanDecisionModel.d.ts +0 -10
  61. package/dist/models/AnnualTrainingPlanDepartmentPlanDecisionModel.js +0 -51
  62. package/dist/models/AnnualTrainingPlanDepartmentPlanModel.d.ts +0 -13
  63. package/dist/models/AnnualTrainingPlanDepartmentPlanModel.js +0 -50
  64. package/dist/models/AnnualTrainingPlanItemModel.d.ts +0 -22
  65. package/dist/models/AnnualTrainingPlanItemModel.js +0 -101
  66. package/dist/models/DocumentMetadataModel.d.ts +0 -45
  67. package/dist/models/DocumentMetadataModel.js +0 -171
  68. package/dist/models/DocumentationDepartmentsModel.d.ts +0 -13
  69. package/dist/models/DocumentationDepartmentsModel.js +0 -53
  70. package/dist/models/FolderModel.d.ts +0 -16
  71. package/dist/models/FolderModel.js +0 -85
  72. package/dist/models/ImportExportMaterialModels.d.ts +0 -92
  73. package/dist/models/ImportExportMaterialModels.js +0 -307
  74. package/dist/models/PermissionModel.d.ts +0 -18
  75. package/dist/models/PermissionModel.js +0 -68
  76. package/dist/models/SecurityAccessApprovalModel.d.ts +0 -23
  77. package/dist/models/SecurityAccessApprovalModel.js +0 -82
  78. package/dist/models/SecurityAccessAttachmentModel.d.ts +0 -12
  79. package/dist/models/SecurityAccessAttachmentModel.js +0 -56
  80. package/dist/models/SecurityAccessChatModel.d.ts +0 -12
  81. package/dist/models/SecurityAccessChatModel.js +0 -56
  82. package/dist/models/SecurityAccessRequestModel.d.ts +0 -25
  83. package/dist/models/SecurityAccessRequestModel.js +0 -80
  84. package/dist/models/SecurityAccessWorkflowModel.d.ts +0 -24
  85. package/dist/models/SecurityAccessWorkflowModel.js +0 -84
  86. package/dist/models/ServiceExtensionAfterAge60Models.d.ts +0 -93
  87. package/dist/models/ServiceExtensionAfterAge60Models.js +0 -312
  88. package/dist/models/UUIDBaseModel.d.ts +0 -14
  89. package/dist/models/UUIDBaseModel.js +0 -66
  90. package/dist/models/WorkingHoursExtensionModels.d.ts +0 -88
  91. package/dist/models/WorkingHoursExtensionModels.js +0 -295
package/src/scripts.ts CHANGED
@@ -1,20 +1,20 @@
1
- import { AppDataSource } from './data-source';
2
-
3
-
4
-
5
- AppDataSource.initialize()
6
-
7
- .then(() => {
8
-
9
- console.log('✅ Database schema synchronized successfully.');
10
-
11
- })
12
-
13
- .catch((error: any) => {
14
-
15
- console.error('❌ Error during schema synchronization:', error);
16
-
17
- process.exit(1);
18
-
19
- });
20
-
1
+ import { AppDataSource } from './data-source';
2
+
3
+
4
+
5
+ AppDataSource.initialize()
6
+
7
+ .then(() => {
8
+
9
+ console.log('✅ Database schema synchronized successfully.');
10
+
11
+ })
12
+
13
+ .catch((error: any) => {
14
+
15
+ console.error('❌ Error during schema synchronization:', error);
16
+
17
+ process.exit(1);
18
+
19
+ });
20
+
@@ -1,90 +1,90 @@
1
- import { EntityManager } from "typeorm";
2
- import { ServiceSlaApproval } from "../models/ServiceSlaApprovalModel";
3
- import { SlaRequest, SlaRequestStatus } from "../models/SlaRequestModel";
4
-
5
- export type PatchSlaApprovalTableInput = Partial<{
6
- approval_status: string;
7
- approver_user_id: number | null;
8
- approver_role_id: number | null;
9
- department_id: number | null;
10
- section_id: number | null;
11
- level: number;
12
- delegate_user_id: number | null;
13
- approved_by: number | null;
14
- comment: string | null;
15
- }>;
16
-
17
- export type PatchSlaRequestTableInput = Partial<{
18
- status: SlaRequestStatus | string;
19
- workflow_execution_id: string | null;
20
- }>;
21
-
22
- function stripUndefined<T extends Record<string, unknown>>(obj: T): Partial<T> {
23
- const out: Partial<T> = {};
24
- for (const key of Object.keys(obj)) {
25
- const v = obj[key];
26
- if (v !== undefined) {
27
- (out as Record<string, unknown>)[key] = v;
28
- }
29
- }
30
- return out;
31
- }
32
-
33
- /**
34
- * TypeORM patches for `sla_approval` and `sla_requests` by the keys used at insert time
35
- * (`source_approval_id` and native `request_id`). Safe to call from any service that shares the DB;
36
- * failures are swallowed so missing SLA rows never block business transactions.
37
- */
38
- export class SlaTableSyncService {
39
- static async patchSlaApprovalBySourceApprovalId(
40
- manager: EntityManager,
41
- sourceApprovalId: number,
42
- patch: PatchSlaApprovalTableInput,
43
- updatedBy?: number | null
44
- ): Promise<void> {
45
- if (!Number.isFinite(sourceApprovalId)) {
46
- return;
47
- }
48
- try {
49
- const setPayload: Record<string, unknown> = {
50
- ...stripUndefined(patch as Record<string, unknown>),
51
- updated_at: new Date()
52
- };
53
- if (updatedBy != null) {
54
- setPayload.updated_by = updatedBy;
55
- }
56
- await manager.getRepository(ServiceSlaApproval).update(
57
- { source_approval_id: sourceApprovalId, is_deleted: false },
58
- setPayload as any
59
- );
60
- } catch {
61
- // non-fatal
62
- }
63
- }
64
-
65
- static async patchSlaRequestByNativeRequestId(
66
- manager: EntityManager,
67
- nativeRequestId: number,
68
- patch: PatchSlaRequestTableInput,
69
- updatedBy?: number | null
70
- ): Promise<void> {
71
- if (!Number.isFinite(nativeRequestId) || nativeRequestId < 1) {
72
- return;
73
- }
74
- try {
75
- const setPayload: Record<string, unknown> = {
76
- ...stripUndefined(patch as Record<string, unknown>),
77
- updated_at: new Date()
78
- };
79
- if (updatedBy != null) {
80
- setPayload.updated_by = updatedBy;
81
- }
82
- await manager.getRepository(SlaRequest).update(
83
- { request_id: nativeRequestId, is_deleted: false },
84
- setPayload as any
85
- );
86
- } catch {
87
- // non-fatal
88
- }
89
- }
90
- }
1
+ import { EntityManager } from "typeorm";
2
+ import { ServiceSlaApproval } from "../models/ServiceSlaApprovalModel";
3
+ import { SlaRequest, SlaRequestStatus } from "../models/SlaRequestModel";
4
+
5
+ export type PatchSlaApprovalTableInput = Partial<{
6
+ approval_status: string;
7
+ approver_user_id: number | null;
8
+ approver_role_id: number | null;
9
+ department_id: number | null;
10
+ section_id: number | null;
11
+ level: number;
12
+ delegate_user_id: number | null;
13
+ approved_by: number | null;
14
+ comment: string | null;
15
+ }>;
16
+
17
+ export type PatchSlaRequestTableInput = Partial<{
18
+ status: SlaRequestStatus | string;
19
+ workflow_execution_id: string | null;
20
+ }>;
21
+
22
+ function stripUndefined<T extends Record<string, unknown>>(obj: T): Partial<T> {
23
+ const out: Partial<T> = {};
24
+ for (const key of Object.keys(obj)) {
25
+ const v = obj[key];
26
+ if (v !== undefined) {
27
+ (out as Record<string, unknown>)[key] = v;
28
+ }
29
+ }
30
+ return out;
31
+ }
32
+
33
+ /**
34
+ * TypeORM patches for `sla_approval` and `sla_requests` by the keys used at insert time
35
+ * (`source_approval_id` and native `request_id`). Safe to call from any service that shares the DB;
36
+ * failures are swallowed so missing SLA rows never block business transactions.
37
+ */
38
+ export class SlaTableSyncService {
39
+ static async patchSlaApprovalBySourceApprovalId(
40
+ manager: EntityManager,
41
+ sourceApprovalId: number,
42
+ patch: PatchSlaApprovalTableInput,
43
+ updatedBy?: number | null
44
+ ): Promise<void> {
45
+ if (!Number.isFinite(sourceApprovalId)) {
46
+ return;
47
+ }
48
+ try {
49
+ const setPayload: Record<string, unknown> = {
50
+ ...stripUndefined(patch as Record<string, unknown>),
51
+ updated_at: new Date()
52
+ };
53
+ if (updatedBy != null) {
54
+ setPayload.updated_by = updatedBy;
55
+ }
56
+ await manager.getRepository(ServiceSlaApproval).update(
57
+ { source_approval_id: sourceApprovalId, is_deleted: false },
58
+ setPayload as any
59
+ );
60
+ } catch {
61
+ // non-fatal
62
+ }
63
+ }
64
+
65
+ static async patchSlaRequestByNativeRequestId(
66
+ manager: EntityManager,
67
+ nativeRequestId: number,
68
+ patch: PatchSlaRequestTableInput,
69
+ updatedBy?: number | null
70
+ ): Promise<void> {
71
+ if (!Number.isFinite(nativeRequestId) || nativeRequestId < 1) {
72
+ return;
73
+ }
74
+ try {
75
+ const setPayload: Record<string, unknown> = {
76
+ ...stripUndefined(patch as Record<string, unknown>),
77
+ updated_at: new Date()
78
+ };
79
+ if (updatedBy != null) {
80
+ setPayload.updated_by = updatedBy;
81
+ }
82
+ await manager.getRepository(SlaRequest).update(
83
+ { request_id: nativeRequestId, is_deleted: false },
84
+ setPayload as any
85
+ );
86
+ } catch {
87
+ // non-fatal
88
+ }
89
+ }
90
+ }
@@ -1,10 +0,0 @@
1
- import { BaseModel } from "./BaseModel";
2
- import { AnnualTrainingPlanDepartmentPlan, AnnualTrainingPlanDepartmentPlanStatus } from "./AnnualTrainingPlanDepartmentPlanModel";
3
- export declare class AnnualTrainingPlanDepartmentPlanDecision extends BaseModel {
4
- department_plan_id: number;
5
- approval_level: number;
6
- status: AnnualTrainingPlanDepartmentPlanStatus;
7
- comment: string | null;
8
- decided_by: number | null;
9
- department_plan: AnnualTrainingPlanDepartmentPlan;
10
- }
@@ -1,51 +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.AnnualTrainingPlanDepartmentPlanDecision = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const BaseModel_1 = require("./BaseModel");
15
- const AnnualTrainingPlanDepartmentPlanModel_1 = require("./AnnualTrainingPlanDepartmentPlanModel");
16
- let AnnualTrainingPlanDepartmentPlanDecision = class AnnualTrainingPlanDepartmentPlanDecision extends BaseModel_1.BaseModel {
17
- };
18
- exports.AnnualTrainingPlanDepartmentPlanDecision = AnnualTrainingPlanDepartmentPlanDecision;
19
- __decorate([
20
- (0, typeorm_1.Column)({ type: "integer", nullable: false }),
21
- __metadata("design:type", Number)
22
- ], AnnualTrainingPlanDepartmentPlanDecision.prototype, "department_plan_id", void 0);
23
- __decorate([
24
- (0, typeorm_1.Column)({ type: "integer", nullable: false }),
25
- __metadata("design:type", Number)
26
- ], AnnualTrainingPlanDepartmentPlanDecision.prototype, "approval_level", void 0);
27
- __decorate([
28
- (0, typeorm_1.Column)({
29
- type: "enum",
30
- enum: AnnualTrainingPlanDepartmentPlanModel_1.AnnualTrainingPlanDepartmentPlanStatus,
31
- nullable: false
32
- }),
33
- __metadata("design:type", String)
34
- ], AnnualTrainingPlanDepartmentPlanDecision.prototype, "status", void 0);
35
- __decorate([
36
- (0, typeorm_1.Column)({ type: "text", nullable: true }),
37
- __metadata("design:type", Object)
38
- ], AnnualTrainingPlanDepartmentPlanDecision.prototype, "comment", void 0);
39
- __decorate([
40
- (0, typeorm_1.Column)({ type: "integer", nullable: true }),
41
- __metadata("design:type", Object)
42
- ], AnnualTrainingPlanDepartmentPlanDecision.prototype, "decided_by", void 0);
43
- __decorate([
44
- (0, typeorm_1.ManyToOne)(() => AnnualTrainingPlanDepartmentPlanModel_1.AnnualTrainingPlanDepartmentPlan, { onDelete: "CASCADE" }),
45
- (0, typeorm_1.JoinColumn)({ name: "department_plan_id" }),
46
- __metadata("design:type", AnnualTrainingPlanDepartmentPlanModel_1.AnnualTrainingPlanDepartmentPlan)
47
- ], AnnualTrainingPlanDepartmentPlanDecision.prototype, "department_plan", void 0);
48
- exports.AnnualTrainingPlanDepartmentPlanDecision = AnnualTrainingPlanDepartmentPlanDecision = __decorate([
49
- (0, typeorm_1.Entity)({ name: "annual_training_plan_department_plan_decisions" }),
50
- (0, typeorm_1.Index)(["department_plan_id", "approval_level"])
51
- ], AnnualTrainingPlanDepartmentPlanDecision);
@@ -1,13 +0,0 @@
1
- import { BaseModel } from "./BaseModel";
2
- import { AnnualTrainingPlanRequest } from "./AnnualTrainingPlanRequestModel";
3
- export declare enum AnnualTrainingPlanDepartmentPlanStatus {
4
- PENDING = "Pending",
5
- APPROVED = "Approved",
6
- REJECTED = "Rejected"
7
- }
8
- export declare class AnnualTrainingPlanDepartmentPlan extends BaseModel {
9
- request_id: number;
10
- department_id: number;
11
- status: AnnualTrainingPlanDepartmentPlanStatus;
12
- request: AnnualTrainingPlanRequest;
13
- }
@@ -1,50 +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.AnnualTrainingPlanDepartmentPlan = exports.AnnualTrainingPlanDepartmentPlanStatus = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const BaseModel_1 = require("./BaseModel");
15
- const AnnualTrainingPlanRequestModel_1 = require("./AnnualTrainingPlanRequestModel");
16
- var AnnualTrainingPlanDepartmentPlanStatus;
17
- (function (AnnualTrainingPlanDepartmentPlanStatus) {
18
- AnnualTrainingPlanDepartmentPlanStatus["PENDING"] = "Pending";
19
- AnnualTrainingPlanDepartmentPlanStatus["APPROVED"] = "Approved";
20
- AnnualTrainingPlanDepartmentPlanStatus["REJECTED"] = "Rejected";
21
- })(AnnualTrainingPlanDepartmentPlanStatus || (exports.AnnualTrainingPlanDepartmentPlanStatus = AnnualTrainingPlanDepartmentPlanStatus = {}));
22
- let AnnualTrainingPlanDepartmentPlan = class AnnualTrainingPlanDepartmentPlan extends BaseModel_1.BaseModel {
23
- };
24
- exports.AnnualTrainingPlanDepartmentPlan = AnnualTrainingPlanDepartmentPlan;
25
- __decorate([
26
- (0, typeorm_1.Column)({ type: "integer", nullable: false }),
27
- __metadata("design:type", Number)
28
- ], AnnualTrainingPlanDepartmentPlan.prototype, "request_id", void 0);
29
- __decorate([
30
- (0, typeorm_1.Column)({ type: "integer", nullable: false }),
31
- __metadata("design:type", Number)
32
- ], AnnualTrainingPlanDepartmentPlan.prototype, "department_id", void 0);
33
- __decorate([
34
- (0, typeorm_1.Column)({
35
- type: "enum",
36
- enum: AnnualTrainingPlanDepartmentPlanStatus,
37
- default: AnnualTrainingPlanDepartmentPlanStatus.PENDING,
38
- nullable: false
39
- }),
40
- __metadata("design:type", String)
41
- ], AnnualTrainingPlanDepartmentPlan.prototype, "status", void 0);
42
- __decorate([
43
- (0, typeorm_1.ManyToOne)(() => AnnualTrainingPlanRequestModel_1.AnnualTrainingPlanRequest, { onDelete: "CASCADE" }),
44
- (0, typeorm_1.JoinColumn)({ name: "request_id" }),
45
- __metadata("design:type", AnnualTrainingPlanRequestModel_1.AnnualTrainingPlanRequest)
46
- ], AnnualTrainingPlanDepartmentPlan.prototype, "request", void 0);
47
- exports.AnnualTrainingPlanDepartmentPlan = AnnualTrainingPlanDepartmentPlan = __decorate([
48
- (0, typeorm_1.Entity)({ name: "annual_training_plan_department_plans" }),
49
- (0, typeorm_1.Index)(["request_id"])
50
- ], AnnualTrainingPlanDepartmentPlan);
@@ -1,22 +0,0 @@
1
- import { BaseModel } from "./BaseModel";
2
- import { AnnualTrainingPlanPlace, AnnualTrainingPlanRequest } from "./AnnualTrainingPlanRequestModel";
3
- export declare class AnnualTrainingPlanItem extends BaseModel {
4
- request_id: number;
5
- department_plan_id: number | null;
6
- row_number: number;
7
- department_id: number;
8
- section_id: number | null;
9
- course_name: string;
10
- no_of_participants: number;
11
- course_cost: number;
12
- total_cost: number;
13
- proposed_implementation_date: string;
14
- description: string;
15
- reason: string;
16
- job_competency: string | null;
17
- place: AnnualTrainingPlanPlace | null;
18
- location: string | null;
19
- name_of_participants: string[] | null;
20
- employee_list: any[] | null;
21
- request: AnnualTrainingPlanRequest;
22
- }
@@ -1,101 +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.AnnualTrainingPlanItem = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const BaseModel_1 = require("./BaseModel");
15
- const AnnualTrainingPlanRequestModel_1 = require("./AnnualTrainingPlanRequestModel");
16
- let AnnualTrainingPlanItem = class AnnualTrainingPlanItem extends BaseModel_1.BaseModel {
17
- };
18
- exports.AnnualTrainingPlanItem = AnnualTrainingPlanItem;
19
- __decorate([
20
- (0, typeorm_1.Column)({ type: "integer", nullable: false }),
21
- __metadata("design:type", Number)
22
- ], AnnualTrainingPlanItem.prototype, "request_id", void 0);
23
- __decorate([
24
- (0, typeorm_1.Column)({ type: "integer", nullable: true }),
25
- __metadata("design:type", Object)
26
- ], AnnualTrainingPlanItem.prototype, "department_plan_id", void 0);
27
- __decorate([
28
- (0, typeorm_1.Column)({ type: "integer", nullable: false }),
29
- __metadata("design:type", Number)
30
- ], AnnualTrainingPlanItem.prototype, "row_number", void 0);
31
- __decorate([
32
- (0, typeorm_1.Column)({ type: "integer", nullable: false }),
33
- __metadata("design:type", Number)
34
- ], AnnualTrainingPlanItem.prototype, "department_id", void 0);
35
- __decorate([
36
- (0, typeorm_1.Column)({ type: "integer", nullable: true }),
37
- __metadata("design:type", Object)
38
- ], AnnualTrainingPlanItem.prototype, "section_id", void 0);
39
- __decorate([
40
- (0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: false }),
41
- __metadata("design:type", String)
42
- ], AnnualTrainingPlanItem.prototype, "course_name", void 0);
43
- __decorate([
44
- (0, typeorm_1.Column)({ type: "integer", nullable: false }),
45
- __metadata("design:type", Number)
46
- ], AnnualTrainingPlanItem.prototype, "no_of_participants", void 0);
47
- __decorate([
48
- (0, typeorm_1.Column)({ type: "decimal", precision: 10, scale: 2, nullable: false }),
49
- __metadata("design:type", Number)
50
- ], AnnualTrainingPlanItem.prototype, "course_cost", void 0);
51
- __decorate([
52
- (0, typeorm_1.Column)({ type: "decimal", precision: 14, scale: 2, nullable: false }),
53
- __metadata("design:type", Number)
54
- ], AnnualTrainingPlanItem.prototype, "total_cost", void 0);
55
- __decorate([
56
- (0, typeorm_1.Column)({ type: "varchar", length: 500, nullable: false }),
57
- __metadata("design:type", String)
58
- ], AnnualTrainingPlanItem.prototype, "proposed_implementation_date", void 0);
59
- __decorate([
60
- (0, typeorm_1.Column)({ type: "text", nullable: false }),
61
- __metadata("design:type", String)
62
- ], AnnualTrainingPlanItem.prototype, "description", void 0);
63
- __decorate([
64
- (0, typeorm_1.Column)({ type: "text", nullable: false }),
65
- __metadata("design:type", String)
66
- ], AnnualTrainingPlanItem.prototype, "reason", void 0);
67
- __decorate([
68
- (0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
69
- __metadata("design:type", Object)
70
- ], AnnualTrainingPlanItem.prototype, "job_competency", void 0);
71
- __decorate([
72
- (0, typeorm_1.Column)({
73
- type: "enum",
74
- enum: AnnualTrainingPlanRequestModel_1.AnnualTrainingPlanPlace,
75
- nullable: true
76
- }),
77
- __metadata("design:type", Object)
78
- ], AnnualTrainingPlanItem.prototype, "place", void 0);
79
- __decorate([
80
- (0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
81
- __metadata("design:type", Object)
82
- ], AnnualTrainingPlanItem.prototype, "location", void 0);
83
- __decorate([
84
- (0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
85
- __metadata("design:type", Object)
86
- ], AnnualTrainingPlanItem.prototype, "name_of_participants", void 0);
87
- __decorate([
88
- (0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
89
- __metadata("design:type", Object)
90
- ], AnnualTrainingPlanItem.prototype, "employee_list", void 0);
91
- __decorate([
92
- (0, typeorm_1.ManyToOne)(() => AnnualTrainingPlanRequestModel_1.AnnualTrainingPlanRequest, { onDelete: "CASCADE" }),
93
- (0, typeorm_1.JoinColumn)({ name: "request_id" }),
94
- __metadata("design:type", AnnualTrainingPlanRequestModel_1.AnnualTrainingPlanRequest)
95
- ], AnnualTrainingPlanItem.prototype, "request", void 0);
96
- exports.AnnualTrainingPlanItem = AnnualTrainingPlanItem = __decorate([
97
- (0, typeorm_1.Entity)({ name: "annual_training_plan_items" }),
98
- (0, typeorm_1.Unique)(["request_id", "row_number"]),
99
- (0, typeorm_1.Index)(["request_id"]),
100
- (0, typeorm_1.Index)(["department_id"])
101
- ], AnnualTrainingPlanItem);
@@ -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
- }