@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.
- package/dist/data-source.js +2 -0
- package/dist/helpers/cancellation-bilingual-persist.helper.d.ts +37 -0
- package/dist/helpers/cancellation-bilingual-persist.helper.js +77 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.js +2 -3
- package/dist/models/AnnualPlanSubmissionRestrictionModel.d.ts +9 -0
- package/dist/models/AnnualPlanSubmissionRestrictionModel.js +47 -0
- package/dist/models/AnnualTrainingPlanRequestModel.d.ts +12 -21
- package/dist/models/AnnualTrainingPlanRequestModel.js +60 -75
- package/dist/models/CyberSecurityRiskManagementRiskModel.d.ts +4 -0
- package/dist/models/CyberSecurityRiskManagementRiskModel.js +16 -0
- package/dist/models/SlaApprovalsViewModel.js +54 -54
- package/package.json +1 -1
- package/scripts/sync-sla-reports-sql.js +92 -92
- package/sql/README.md +21 -21
- package/sql/add_csrm_risk_tracking_fields.sql +6 -0
- package/sql/add_training_request_reference_number.sql +9 -9
- package/sql/add_training_room_booking_records_reference.sql +19 -19
- package/sql/annual_training_plan_bulk_upload.sql +140 -140
- package/sql/annual_training_plan_department_plans.sql +80 -80
- package/sql/create_annual_plan_submission_restriction.sql +27 -0
- package/sql/sla_reports_admin_procedures.sql +322 -322
- package/sql/sla_reports_approvals_workbook.sql +427 -427
- package/sql/sla_reports_procedures.sql +883 -883
- package/sql/vw_sla_approvals.sql +115 -115
- package/sql/vw_sla_my_requests.sql +58 -58
- package/src/data-source.ts +2 -0
- package/src/index.ts +521 -518
- package/src/models/AccessCardRequestModel.ts +135 -135
- package/src/models/AirportEntryPermitModel.ts +276 -276
- package/src/models/AnnualPlanSubmissionRestrictionModel.ts +27 -0
- package/src/models/AnnualTrainingPlanDepartmentPlanDecisionModel.ts +33 -33
- package/src/models/AnnualTrainingPlanDepartmentPlanModel.ts +31 -31
- package/src/models/AnnualTrainingPlanItemModel.ts +71 -71
- package/src/models/AnnualTrainingPlanRequestModel.ts +156 -156
- package/src/models/CyberSecurityRiskManagementRiskModel.ts +12 -0
- package/src/models/DocumentDriveModel.ts +28 -28
- package/src/models/DocumentFolderModel.ts +45 -45
- package/src/models/HotelApprovalModel.ts +83 -83
- package/src/models/HousingContractCancelApprovalModel.ts +64 -64
- package/src/models/HousingContractRenewalApprovalModel.ts +64 -64
- package/src/models/ITRequestAttachmentModel.ts +73 -73
- package/src/models/ItApprovalsModel.ts +84 -84
- package/src/models/LegalConsultationApprovalModel.ts +65 -65
- package/src/models/MissionTravelPassportExpiryNotificationConfigModel.ts +36 -36
- package/src/models/NotificationModel.ts +89 -89
- package/src/models/ResidentialUnitRentalApprovalModel.ts +143 -143
- package/src/models/ServiceExtensionAfter60ApprovalModel.ts +87 -87
- package/src/models/ServiceSlaApprovalModel.ts +64 -64
- package/src/models/ServicesNotificationConfigModel.ts +55 -55
- package/src/models/SlaApprovalsViewModel.ts +142 -142
- package/src/models/StudyLeaveRequestModel.ts +173 -173
- package/src/models/TrainingRequestModel.ts +169 -169
- package/src/models/TrainingRoomBookingRequestModel.ts +178 -178
- package/src/models/TrainingRoomBookingWorkflowModel.ts +81 -81
- package/src/models/TrainingRoomNotificationConfigModel.ts +30 -30
- package/src/models/role.ts +34 -34
- package/src/scripts.ts +20 -20
- package/src/sla/sla-table-sync.service.ts +90 -90
- package/dist/models/AnnualTrainingPlanDepartmentPlanDecisionModel.d.ts +0 -10
- package/dist/models/AnnualTrainingPlanDepartmentPlanDecisionModel.js +0 -51
- package/dist/models/AnnualTrainingPlanDepartmentPlanModel.d.ts +0 -13
- package/dist/models/AnnualTrainingPlanDepartmentPlanModel.js +0 -50
- package/dist/models/AnnualTrainingPlanItemModel.d.ts +0 -22
- package/dist/models/AnnualTrainingPlanItemModel.js +0 -101
- package/dist/models/DocumentMetadataModel.d.ts +0 -45
- package/dist/models/DocumentMetadataModel.js +0 -171
- package/dist/models/DocumentationDepartmentsModel.d.ts +0 -13
- package/dist/models/DocumentationDepartmentsModel.js +0 -53
- package/dist/models/FolderModel.d.ts +0 -16
- package/dist/models/FolderModel.js +0 -85
- package/dist/models/ImportExportMaterialModels.d.ts +0 -92
- package/dist/models/ImportExportMaterialModels.js +0 -307
- package/dist/models/PermissionModel.d.ts +0 -18
- package/dist/models/PermissionModel.js +0 -68
- package/dist/models/SecurityAccessApprovalModel.d.ts +0 -23
- package/dist/models/SecurityAccessApprovalModel.js +0 -82
- package/dist/models/SecurityAccessAttachmentModel.d.ts +0 -12
- package/dist/models/SecurityAccessAttachmentModel.js +0 -56
- package/dist/models/SecurityAccessChatModel.d.ts +0 -12
- package/dist/models/SecurityAccessChatModel.js +0 -56
- package/dist/models/SecurityAccessRequestModel.d.ts +0 -25
- package/dist/models/SecurityAccessRequestModel.js +0 -80
- package/dist/models/SecurityAccessWorkflowModel.d.ts +0 -24
- package/dist/models/SecurityAccessWorkflowModel.js +0 -84
- package/dist/models/ServiceExtensionAfterAge60Models.d.ts +0 -93
- package/dist/models/ServiceExtensionAfterAge60Models.js +0 -312
- package/dist/models/UUIDBaseModel.d.ts +0 -14
- package/dist/models/UUIDBaseModel.js +0 -66
- package/dist/models/WorkingHoursExtensionModels.d.ts +0 -88
- package/dist/models/WorkingHoursExtensionModels.js +0 -295
package/dist/data-source.js
CHANGED
|
@@ -275,6 +275,7 @@ const ComplaintLostPropertyReportRequestModel_1 = require("./models/ComplaintLos
|
|
|
275
275
|
const ComplaintLostPropertyReportWorkflowModel_1 = require("./models/ComplaintLostPropertyReportWorkflowModel");
|
|
276
276
|
const ContractServiceRequestModel_1 = require("./models/ContractServiceRequestModel");
|
|
277
277
|
const ContractServiceRequestDocumentModel_1 = require("./models/ContractServiceRequestDocumentModel");
|
|
278
|
+
const AnnualPlanSubmissionRestrictionModel_1 = require("./models/AnnualPlanSubmissionRestrictionModel");
|
|
278
279
|
const CountryMasterModel_1 = require("./models/CountryMasterModel");
|
|
279
280
|
const CyberSecurityAuditRequestModel_1 = require("./models/CyberSecurityAuditRequestModel");
|
|
280
281
|
const CyberSecurityRiskManagementRequestModel_1 = require("./models/CyberSecurityRiskManagementRequestModel");
|
|
@@ -601,6 +602,7 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
601
602
|
ComplaintLostPropertyReportWorkflowModel_1.ComplaintLostPropertyReportWorkflow,
|
|
602
603
|
ContractServiceRequestModel_1.ContractServiceRequest,
|
|
603
604
|
ContractServiceRequestDocumentModel_1.ContractServiceRequestDocument,
|
|
605
|
+
AnnualPlanSubmissionRestrictionModel_1.AnnualPlanSubmissionRestriction,
|
|
604
606
|
CountryMasterModel_1.CountryMaster,
|
|
605
607
|
CyberSecurityAuditRequestModel_1.CyberSecurityAuditRequest,
|
|
606
608
|
CyberSecurityRiskManagementRequestModel_1.CyberSecurityRiskManagementRequest,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { EntityManager } from 'typeorm';
|
|
2
|
+
import { CancellationMessageType } from '../models/CancellationChatModel';
|
|
3
|
+
import { CancellationWorkFlowStatus } from '../models/CancellationWorkflowModel';
|
|
4
|
+
export type CancellationWorkflowRowInput = {
|
|
5
|
+
request_id: number;
|
|
6
|
+
service_id?: number | null;
|
|
7
|
+
sub_service_id?: number | null;
|
|
8
|
+
content: string;
|
|
9
|
+
content_ar?: string | null;
|
|
10
|
+
status: CancellationWorkFlowStatus;
|
|
11
|
+
status_ar?: string | null;
|
|
12
|
+
user_id?: number | null;
|
|
13
|
+
role_id?: number | null;
|
|
14
|
+
department_id?: number | null;
|
|
15
|
+
section_id?: number | null;
|
|
16
|
+
step_order?: number | null;
|
|
17
|
+
created_by?: number | null;
|
|
18
|
+
};
|
|
19
|
+
export type CancellationChatRowInput = {
|
|
20
|
+
request_id: number;
|
|
21
|
+
service_id?: number | null;
|
|
22
|
+
sub_service_id?: number | null;
|
|
23
|
+
user_id: number;
|
|
24
|
+
role_id?: number | null;
|
|
25
|
+
message: string;
|
|
26
|
+
message_ar?: string | null;
|
|
27
|
+
messageType?: CancellationMessageType;
|
|
28
|
+
status?: string | null;
|
|
29
|
+
status_ar?: string | null;
|
|
30
|
+
created_by?: number | string | null;
|
|
31
|
+
};
|
|
32
|
+
/** Force-persist Arabic workflow columns (guards against stale TypeORM entity metadata). */
|
|
33
|
+
export declare function patchCancellationWorkflowArabic(manager: EntityManager, workflowId: number, contentAr: string | null, statusAr: string | null): Promise<void>;
|
|
34
|
+
/** Force-persist Arabic chat columns (guards against stale TypeORM entity metadata). */
|
|
35
|
+
export declare function patchCancellationChatArabic(manager: EntityManager, chatId: number, messageAr: string | null, statusAr: string | null): Promise<void>;
|
|
36
|
+
export declare function insertCancellationWorkflowRow(manager: EntityManager, input: CancellationWorkflowRowInput): Promise<number>;
|
|
37
|
+
export declare function insertCancellationChatRow(manager: EntityManager, input: CancellationChatRowInput): Promise<number>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.patchCancellationWorkflowArabic = patchCancellationWorkflowArabic;
|
|
4
|
+
exports.patchCancellationChatArabic = patchCancellationChatArabic;
|
|
5
|
+
exports.insertCancellationWorkflowRow = insertCancellationWorkflowRow;
|
|
6
|
+
exports.insertCancellationChatRow = insertCancellationChatRow;
|
|
7
|
+
const CancellationChatModel_1 = require("../models/CancellationChatModel");
|
|
8
|
+
const CancellationWorkflowModel_1 = require("../models/CancellationWorkflowModel");
|
|
9
|
+
const workflow_chat_i18n_1 = require("../i18n/workflow-chat-i18n");
|
|
10
|
+
function resolveWorkflowRowId(insertResult) {
|
|
11
|
+
const id = insertResult.raw?.[0]?.id ?? insertResult.identifiers?.[0]?.id;
|
|
12
|
+
if (!id) {
|
|
13
|
+
throw new Error('Failed to insert cancellation workflow row');
|
|
14
|
+
}
|
|
15
|
+
return id;
|
|
16
|
+
}
|
|
17
|
+
function resolveChatRowId(insertResult) {
|
|
18
|
+
const id = insertResult.raw?.[0]?.id ?? insertResult.identifiers?.[0]?.id;
|
|
19
|
+
if (!id) {
|
|
20
|
+
throw new Error('Failed to insert cancellation chat row');
|
|
21
|
+
}
|
|
22
|
+
return id;
|
|
23
|
+
}
|
|
24
|
+
/** Force-persist Arabic workflow columns (guards against stale TypeORM entity metadata). */
|
|
25
|
+
async function patchCancellationWorkflowArabic(manager, workflowId, contentAr, statusAr) {
|
|
26
|
+
await manager.query(`UPDATE cancellation_workflows
|
|
27
|
+
SET content_ar = $1,
|
|
28
|
+
status_ar = $2,
|
|
29
|
+
updated_at = CURRENT_TIMESTAMP
|
|
30
|
+
WHERE id = $3`, [contentAr, statusAr, workflowId]);
|
|
31
|
+
}
|
|
32
|
+
/** Force-persist Arabic chat columns (guards against stale TypeORM entity metadata). */
|
|
33
|
+
async function patchCancellationChatArabic(manager, chatId, messageAr, statusAr) {
|
|
34
|
+
await manager.query(`UPDATE cancellation_chats
|
|
35
|
+
SET message_ar = $1,
|
|
36
|
+
status_ar = $2,
|
|
37
|
+
updated_at = CURRENT_TIMESTAMP
|
|
38
|
+
WHERE id = $3`, [messageAr, statusAr, chatId]);
|
|
39
|
+
}
|
|
40
|
+
async function insertCancellationWorkflowRow(manager, input) {
|
|
41
|
+
const contentAr = input.content_ar ?? null;
|
|
42
|
+
const statusAr = input.status_ar ?? (0, workflow_chat_i18n_1.resolveWorkflowStatusAr)(input.status);
|
|
43
|
+
const insertResult = await manager
|
|
44
|
+
.createQueryBuilder()
|
|
45
|
+
.insert()
|
|
46
|
+
.into(CancellationWorkflowModel_1.CancellationWorkFlow)
|
|
47
|
+
.values({
|
|
48
|
+
...input,
|
|
49
|
+
content_ar: contentAr,
|
|
50
|
+
status_ar: statusAr,
|
|
51
|
+
})
|
|
52
|
+
.returning('id')
|
|
53
|
+
.execute();
|
|
54
|
+
const id = resolveWorkflowRowId(insertResult);
|
|
55
|
+
await patchCancellationWorkflowArabic(manager, id, contentAr, statusAr);
|
|
56
|
+
return id;
|
|
57
|
+
}
|
|
58
|
+
async function insertCancellationChatRow(manager, input) {
|
|
59
|
+
const messageAr = input.message_ar ?? null;
|
|
60
|
+
const statusAr = input.status_ar ?? (0, workflow_chat_i18n_1.resolveChatStatusAr)(input.status ?? null);
|
|
61
|
+
const messageType = input.messageType ?? CancellationChatModel_1.CancellationMessageType.TEXT;
|
|
62
|
+
const insertResult = await manager
|
|
63
|
+
.createQueryBuilder()
|
|
64
|
+
.insert()
|
|
65
|
+
.into(CancellationChatModel_1.CancellationRequestChat)
|
|
66
|
+
.values({
|
|
67
|
+
...input,
|
|
68
|
+
message_ar: messageAr,
|
|
69
|
+
status_ar: statusAr,
|
|
70
|
+
messageType,
|
|
71
|
+
})
|
|
72
|
+
.returning('id')
|
|
73
|
+
.execute();
|
|
74
|
+
const id = resolveChatRowId(insertResult);
|
|
75
|
+
await patchCancellationChatArabic(manager, id, messageAr, statusAr);
|
|
76
|
+
return id;
|
|
77
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -174,9 +174,6 @@ export { StudyLeaveRequestChat } from './models/StudyLeaveChatModel';
|
|
|
174
174
|
export { StudyLeaveMessageType } from './models/StudyLeaveChatModel';
|
|
175
175
|
export { StudyLeaveChatStatus } from './models/StudyLeaveChatModel';
|
|
176
176
|
export * from './models/AnnualTrainingPlanRequestModel';
|
|
177
|
-
export * from './models/AnnualTrainingPlanItemModel';
|
|
178
|
-
export * from './models/AnnualTrainingPlanDepartmentPlanModel';
|
|
179
|
-
export * from './models/AnnualTrainingPlanDepartmentPlanDecisionModel';
|
|
180
177
|
export * from './models/AnnualTrainingPlanWorkflowModel';
|
|
181
178
|
export * from './models/AnnualTrainingPlanApprovalModel';
|
|
182
179
|
export * from './models/AnnualTrainingPlanChatModel';
|
|
@@ -278,6 +275,7 @@ export * from './models/JobTransferRequestModel';
|
|
|
278
275
|
export { JobTransferRequestStatus } from './models/JobTransferRequestModel';
|
|
279
276
|
export * from './models/NewResourceRequestModel';
|
|
280
277
|
export { NewResourceRequestStatus } from './models/NewResourceRequestModel';
|
|
278
|
+
export * from './models/AnnualPlanSubmissionRestrictionModel';
|
|
281
279
|
export * from './models/CountryMasterModel';
|
|
282
280
|
export * from './models/CAIRatingMasterModel';
|
|
283
281
|
export * from './models/CSRMLikelihoodMasterModel';
|
package/dist/index.js
CHANGED
|
@@ -235,9 +235,6 @@ Object.defineProperty(exports, "StudyLeaveMessageType", { enumerable: true, get:
|
|
|
235
235
|
var StudyLeaveChatModel_3 = require("./models/StudyLeaveChatModel");
|
|
236
236
|
Object.defineProperty(exports, "StudyLeaveChatStatus", { enumerable: true, get: function () { return StudyLeaveChatModel_3.StudyLeaveChatStatus; } });
|
|
237
237
|
__exportStar(require("./models/AnnualTrainingPlanRequestModel"), exports);
|
|
238
|
-
__exportStar(require("./models/AnnualTrainingPlanItemModel"), exports);
|
|
239
|
-
__exportStar(require("./models/AnnualTrainingPlanDepartmentPlanModel"), exports);
|
|
240
|
-
__exportStar(require("./models/AnnualTrainingPlanDepartmentPlanDecisionModel"), exports);
|
|
241
238
|
__exportStar(require("./models/AnnualTrainingPlanWorkflowModel"), exports);
|
|
242
239
|
__exportStar(require("./models/AnnualTrainingPlanApprovalModel"), exports);
|
|
243
240
|
__exportStar(require("./models/AnnualTrainingPlanChatModel"), exports);
|
|
@@ -420,6 +417,8 @@ Object.defineProperty(exports, "JobTransferRequestStatus", { enumerable: true, g
|
|
|
420
417
|
__exportStar(require("./models/NewResourceRequestModel"), exports);
|
|
421
418
|
var NewResourceRequestModel_1 = require("./models/NewResourceRequestModel");
|
|
422
419
|
Object.defineProperty(exports, "NewResourceRequestStatus", { enumerable: true, get: function () { return NewResourceRequestModel_1.NewResourceRequestStatus; } });
|
|
420
|
+
// Annual plan submission restriction master
|
|
421
|
+
__exportStar(require("./models/AnnualPlanSubmissionRestrictionModel"), exports);
|
|
423
422
|
// Country Master
|
|
424
423
|
__exportStar(require("./models/CountryMasterModel"), exports);
|
|
425
424
|
__exportStar(require("./models/CAIRatingMasterModel"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export type AnnualPlanSubmissionRestrictionStatus = 'Active' | 'Inactive';
|
|
3
|
+
export declare class AnnualPlanSubmissionRestriction extends BaseModel {
|
|
4
|
+
user_id: number;
|
|
5
|
+
department_id: number;
|
|
6
|
+
section_id: number;
|
|
7
|
+
status: AnnualPlanSubmissionRestrictionStatus;
|
|
8
|
+
constructor(userId?: number, departmentId?: number, sectionId?: number);
|
|
9
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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.AnnualPlanSubmissionRestriction = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let AnnualPlanSubmissionRestriction = class AnnualPlanSubmissionRestriction extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor(userId, departmentId, sectionId) {
|
|
17
|
+
super();
|
|
18
|
+
if (userId != null)
|
|
19
|
+
this.user_id = userId;
|
|
20
|
+
if (departmentId != null)
|
|
21
|
+
this.department_id = departmentId;
|
|
22
|
+
if (sectionId != null)
|
|
23
|
+
this.section_id = sectionId;
|
|
24
|
+
this.status = 'Active';
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.AnnualPlanSubmissionRestriction = AnnualPlanSubmissionRestriction;
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: false }),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], AnnualPlanSubmissionRestriction.prototype, "user_id", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: false }),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
|
+
], AnnualPlanSubmissionRestriction.prototype, "department_id", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: false }),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], AnnualPlanSubmissionRestriction.prototype, "section_id", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 20, default: 'Active' }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], AnnualPlanSubmissionRestriction.prototype, "status", void 0);
|
|
44
|
+
exports.AnnualPlanSubmissionRestriction = AnnualPlanSubmissionRestriction = __decorate([
|
|
45
|
+
(0, typeorm_1.Entity)({ name: 'annual_plan_submission_restriction' }),
|
|
46
|
+
__metadata("design:paramtypes", [Number, Number, Number])
|
|
47
|
+
], AnnualPlanSubmissionRestriction);
|
|
@@ -10,15 +10,6 @@ export declare enum AnnualTrainingPlanPlace {
|
|
|
10
10
|
INSIDE = "Inside",
|
|
11
11
|
OUTSIDE = "Outside"
|
|
12
12
|
}
|
|
13
|
-
export declare enum AnnualTrainingPlanImportStatus {
|
|
14
|
-
VALIDATED = "Validated",
|
|
15
|
-
IMPORTED = "Imported",
|
|
16
|
-
FAILED = "Failed"
|
|
17
|
-
}
|
|
18
|
-
export declare enum AnnualTrainingPlanSubmissionSource {
|
|
19
|
-
EXCEL = "Excel",
|
|
20
|
-
DIRECT = "Direct"
|
|
21
|
-
}
|
|
22
13
|
export declare class AnnualTrainingPlanRequest extends BaseModel {
|
|
23
14
|
req_user_department_id: number | null;
|
|
24
15
|
req_user_section_id: number | null;
|
|
@@ -26,23 +17,23 @@ export declare class AnnualTrainingPlanRequest extends BaseModel {
|
|
|
26
17
|
service_id: number | null;
|
|
27
18
|
sub_service_id: number | null;
|
|
28
19
|
user_id: number;
|
|
20
|
+
course_name: string;
|
|
21
|
+
no_of_participants: number;
|
|
22
|
+
course_cost: number;
|
|
29
23
|
total_cost: number;
|
|
24
|
+
proposed_implementation_date: string;
|
|
25
|
+
description: string;
|
|
26
|
+
place: AnnualTrainingPlanPlace | null;
|
|
27
|
+
location: string | null;
|
|
28
|
+
reason: string;
|
|
29
|
+
employee_list: any[] | null;
|
|
30
30
|
status: AnnualTrainingPlanRequestStatus;
|
|
31
31
|
reviewer_user_id: number | null;
|
|
32
32
|
assigned_to_user_id: number | null;
|
|
33
33
|
assigned_at: Date | null;
|
|
34
34
|
workflow_execution_id: string | null;
|
|
35
|
+
job_competency: string | null;
|
|
36
|
+
name_of_participants: string[] | null;
|
|
35
37
|
directarate: string | null;
|
|
36
|
-
|
|
37
|
-
plan_number: string | null;
|
|
38
|
-
plan_year: number | null;
|
|
39
|
-
source_file_url: string | null;
|
|
40
|
-
source_file_name: string | null;
|
|
41
|
-
total_departments: number;
|
|
42
|
-
total_courses: number;
|
|
43
|
-
total_participants: number;
|
|
44
|
-
import_status: AnnualTrainingPlanImportStatus | null;
|
|
45
|
-
submission_source: AnnualTrainingPlanSubmissionSource | null;
|
|
46
|
-
reference_number: string | null;
|
|
47
|
-
constructor(user_id: number, status?: AnnualTrainingPlanRequestStatus, service_id?: number | null, sub_service_id?: number | null, req_user_department_id?: number | null, req_user_section_id?: number | null, req_user_position_id?: number | null, reviewer_user_id?: number | null, assigned_to_user_id?: number | null, assigned_at?: Date | null, workflow_execution_id?: string | null, directarate?: string | null);
|
|
38
|
+
constructor(user_id: number, course_name: string, no_of_participants: number, course_cost: number, total_cost: number, proposed_implementation_date: string, description: string, place: AnnualTrainingPlanPlace | null, reason: string, status?: AnnualTrainingPlanRequestStatus, service_id?: number | null, sub_service_id?: number | null, req_user_department_id?: number | null, req_user_section_id?: number | null, req_user_position_id?: number | null, location?: string | null, employee_list?: any[] | null, reviewer_user_id?: number | null, assigned_to_user_id?: number | null, assigned_at?: Date | null, workflow_execution_id?: string | null, job_competency?: string | null, name_of_participants?: string[] | null, directarate?: string | null);
|
|
48
39
|
}
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AnnualTrainingPlanRequest = exports.
|
|
12
|
+
exports.AnnualTrainingPlanRequest = exports.AnnualTrainingPlanPlace = exports.AnnualTrainingPlanRequestStatus = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const BaseModel_1 = require("./BaseModel");
|
|
15
15
|
var AnnualTrainingPlanRequestStatus;
|
|
@@ -25,44 +25,33 @@ var AnnualTrainingPlanPlace;
|
|
|
25
25
|
AnnualTrainingPlanPlace["INSIDE"] = "Inside";
|
|
26
26
|
AnnualTrainingPlanPlace["OUTSIDE"] = "Outside";
|
|
27
27
|
})(AnnualTrainingPlanPlace || (exports.AnnualTrainingPlanPlace = AnnualTrainingPlanPlace = {}));
|
|
28
|
-
var AnnualTrainingPlanImportStatus;
|
|
29
|
-
(function (AnnualTrainingPlanImportStatus) {
|
|
30
|
-
AnnualTrainingPlanImportStatus["VALIDATED"] = "Validated";
|
|
31
|
-
AnnualTrainingPlanImportStatus["IMPORTED"] = "Imported";
|
|
32
|
-
AnnualTrainingPlanImportStatus["FAILED"] = "Failed";
|
|
33
|
-
})(AnnualTrainingPlanImportStatus || (exports.AnnualTrainingPlanImportStatus = AnnualTrainingPlanImportStatus = {}));
|
|
34
|
-
var AnnualTrainingPlanSubmissionSource;
|
|
35
|
-
(function (AnnualTrainingPlanSubmissionSource) {
|
|
36
|
-
AnnualTrainingPlanSubmissionSource["EXCEL"] = "Excel";
|
|
37
|
-
AnnualTrainingPlanSubmissionSource["DIRECT"] = "Direct";
|
|
38
|
-
})(AnnualTrainingPlanSubmissionSource || (exports.AnnualTrainingPlanSubmissionSource = AnnualTrainingPlanSubmissionSource = {}));
|
|
39
28
|
let AnnualTrainingPlanRequest = class AnnualTrainingPlanRequest extends BaseModel_1.BaseModel {
|
|
40
|
-
constructor(user_id, status = AnnualTrainingPlanRequestStatus.PENDING, service_id, sub_service_id, req_user_department_id, req_user_section_id, req_user_position_id, reviewer_user_id, assigned_to_user_id, assigned_at, workflow_execution_id, directarate) {
|
|
29
|
+
constructor(user_id, course_name, no_of_participants, course_cost, total_cost, proposed_implementation_date, description, place, reason, status = AnnualTrainingPlanRequestStatus.PENDING, service_id, sub_service_id, req_user_department_id, req_user_section_id, req_user_position_id, location, employee_list, reviewer_user_id, assigned_to_user_id, assigned_at, workflow_execution_id, job_competency, name_of_participants, directarate) {
|
|
41
30
|
super();
|
|
42
31
|
this.user_id = user_id;
|
|
43
|
-
this.
|
|
32
|
+
this.course_name = course_name;
|
|
33
|
+
this.no_of_participants = no_of_participants;
|
|
34
|
+
this.course_cost = course_cost;
|
|
35
|
+
this.total_cost = total_cost;
|
|
36
|
+
this.proposed_implementation_date = proposed_implementation_date;
|
|
37
|
+
this.description = description;
|
|
38
|
+
this.place = place;
|
|
39
|
+
this.reason = reason;
|
|
44
40
|
this.status = status;
|
|
45
41
|
this.service_id = service_id || null;
|
|
46
42
|
this.sub_service_id = sub_service_id || null;
|
|
47
43
|
this.req_user_department_id = req_user_department_id || null;
|
|
48
44
|
this.req_user_section_id = req_user_section_id || null;
|
|
49
45
|
this.req_user_position_id = req_user_position_id || null;
|
|
46
|
+
this.location = location || null;
|
|
47
|
+
this.employee_list = employee_list || null;
|
|
50
48
|
this.reviewer_user_id = reviewer_user_id || null;
|
|
51
49
|
this.assigned_to_user_id = assigned_to_user_id || null;
|
|
52
50
|
this.assigned_at = assigned_at || null;
|
|
53
51
|
this.workflow_execution_id = workflow_execution_id || null;
|
|
52
|
+
this.job_competency = job_competency ?? null;
|
|
53
|
+
this.name_of_participants = name_of_participants ?? null;
|
|
54
54
|
this.directarate = directarate ?? null;
|
|
55
|
-
this.plan_name = null;
|
|
56
|
-
this.plan_number = null;
|
|
57
|
-
this.plan_year = null;
|
|
58
|
-
this.source_file_url = null;
|
|
59
|
-
this.source_file_name = null;
|
|
60
|
-
this.total_departments = 0;
|
|
61
|
-
this.total_courses = 0;
|
|
62
|
-
this.total_participants = 0;
|
|
63
|
-
this.import_status = null;
|
|
64
|
-
this.submission_source = null;
|
|
65
|
-
this.reference_number = null;
|
|
66
55
|
}
|
|
67
56
|
};
|
|
68
57
|
exports.AnnualTrainingPlanRequest = AnnualTrainingPlanRequest;
|
|
@@ -91,9 +80,49 @@ __decorate([
|
|
|
91
80
|
__metadata("design:type", Number)
|
|
92
81
|
], AnnualTrainingPlanRequest.prototype, "user_id", void 0);
|
|
93
82
|
__decorate([
|
|
94
|
-
(0, typeorm_1.Column)({ type: "
|
|
83
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: false }),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], AnnualTrainingPlanRequest.prototype, "course_name", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: false }),
|
|
88
|
+
__metadata("design:type", Number)
|
|
89
|
+
], AnnualTrainingPlanRequest.prototype, "no_of_participants", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, typeorm_1.Column)({ type: "decimal", precision: 10, scale: 2, nullable: false }),
|
|
92
|
+
__metadata("design:type", Number)
|
|
93
|
+
], AnnualTrainingPlanRequest.prototype, "course_cost", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, typeorm_1.Column)({ type: "decimal", precision: 10, scale: 2, nullable: false }),
|
|
95
96
|
__metadata("design:type", Number)
|
|
96
97
|
], AnnualTrainingPlanRequest.prototype, "total_cost", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 500, nullable: false, default: "" }),
|
|
100
|
+
__metadata("design:type", String)
|
|
101
|
+
], AnnualTrainingPlanRequest.prototype, "proposed_implementation_date", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, typeorm_1.Column)({ type: "text", nullable: false }),
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], AnnualTrainingPlanRequest.prototype, "description", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, typeorm_1.Column)({
|
|
108
|
+
type: "enum",
|
|
109
|
+
enum: AnnualTrainingPlanPlace,
|
|
110
|
+
nullable: true
|
|
111
|
+
}),
|
|
112
|
+
__metadata("design:type", Object)
|
|
113
|
+
], AnnualTrainingPlanRequest.prototype, "place", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
116
|
+
__metadata("design:type", Object)
|
|
117
|
+
], AnnualTrainingPlanRequest.prototype, "location", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, typeorm_1.Column)({ type: "text", nullable: false }),
|
|
120
|
+
__metadata("design:type", String)
|
|
121
|
+
], AnnualTrainingPlanRequest.prototype, "reason", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
|
|
124
|
+
__metadata("design:type", Object)
|
|
125
|
+
], AnnualTrainingPlanRequest.prototype, "employee_list", void 0);
|
|
97
126
|
__decorate([
|
|
98
127
|
(0, typeorm_1.Column)({
|
|
99
128
|
type: "enum",
|
|
@@ -122,60 +151,16 @@ __decorate([
|
|
|
122
151
|
__decorate([
|
|
123
152
|
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
124
153
|
__metadata("design:type", Object)
|
|
125
|
-
], AnnualTrainingPlanRequest.prototype, "
|
|
126
|
-
__decorate([
|
|
127
|
-
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
128
|
-
__metadata("design:type", Object)
|
|
129
|
-
], AnnualTrainingPlanRequest.prototype, "plan_name", void 0);
|
|
130
|
-
__decorate([
|
|
131
|
-
(0, typeorm_1.Column)({ type: "varchar", length: 30, nullable: true, unique: true }),
|
|
132
|
-
__metadata("design:type", Object)
|
|
133
|
-
], AnnualTrainingPlanRequest.prototype, "plan_number", void 0);
|
|
154
|
+
], AnnualTrainingPlanRequest.prototype, "job_competency", void 0);
|
|
134
155
|
__decorate([
|
|
135
|
-
(0, typeorm_1.Column)({ type: "
|
|
156
|
+
(0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
|
|
136
157
|
__metadata("design:type", Object)
|
|
137
|
-
], AnnualTrainingPlanRequest.prototype, "
|
|
138
|
-
__decorate([
|
|
139
|
-
(0, typeorm_1.Column)({ type: "varchar", length: 1000, nullable: true }),
|
|
140
|
-
__metadata("design:type", Object)
|
|
141
|
-
], AnnualTrainingPlanRequest.prototype, "source_file_url", void 0);
|
|
158
|
+
], AnnualTrainingPlanRequest.prototype, "name_of_participants", void 0);
|
|
142
159
|
__decorate([
|
|
143
160
|
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
144
161
|
__metadata("design:type", Object)
|
|
145
|
-
], AnnualTrainingPlanRequest.prototype, "
|
|
146
|
-
__decorate([
|
|
147
|
-
(0, typeorm_1.Column)({ type: "integer", nullable: false, default: 0 }),
|
|
148
|
-
__metadata("design:type", Number)
|
|
149
|
-
], AnnualTrainingPlanRequest.prototype, "total_departments", void 0);
|
|
150
|
-
__decorate([
|
|
151
|
-
(0, typeorm_1.Column)({ type: "integer", nullable: false, default: 0 }),
|
|
152
|
-
__metadata("design:type", Number)
|
|
153
|
-
], AnnualTrainingPlanRequest.prototype, "total_courses", void 0);
|
|
154
|
-
__decorate([
|
|
155
|
-
(0, typeorm_1.Column)({ type: "integer", nullable: false, default: 0 }),
|
|
156
|
-
__metadata("design:type", Number)
|
|
157
|
-
], AnnualTrainingPlanRequest.prototype, "total_participants", void 0);
|
|
158
|
-
__decorate([
|
|
159
|
-
(0, typeorm_1.Column)({
|
|
160
|
-
type: "enum",
|
|
161
|
-
enum: AnnualTrainingPlanImportStatus,
|
|
162
|
-
nullable: true
|
|
163
|
-
}),
|
|
164
|
-
__metadata("design:type", Object)
|
|
165
|
-
], AnnualTrainingPlanRequest.prototype, "import_status", void 0);
|
|
166
|
-
__decorate([
|
|
167
|
-
(0, typeorm_1.Column)({
|
|
168
|
-
type: "enum",
|
|
169
|
-
enum: AnnualTrainingPlanSubmissionSource,
|
|
170
|
-
nullable: true
|
|
171
|
-
}),
|
|
172
|
-
__metadata("design:type", Object)
|
|
173
|
-
], AnnualTrainingPlanRequest.prototype, "submission_source", void 0);
|
|
174
|
-
__decorate([
|
|
175
|
-
(0, typeorm_1.Column)({ type: "varchar", length: 20, nullable: true, unique: true }),
|
|
176
|
-
__metadata("design:type", Object)
|
|
177
|
-
], AnnualTrainingPlanRequest.prototype, "reference_number", void 0);
|
|
162
|
+
], AnnualTrainingPlanRequest.prototype, "directarate", void 0);
|
|
178
163
|
exports.AnnualTrainingPlanRequest = AnnualTrainingPlanRequest = __decorate([
|
|
179
164
|
(0, typeorm_1.Entity)({ name: "annual_training_plan_requests" }),
|
|
180
|
-
__metadata("design:paramtypes", [Number, String, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object])
|
|
165
|
+
__metadata("design:paramtypes", [Number, String, Number, Number, Number, String, String, Object, String, String, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object])
|
|
181
166
|
], AnnualTrainingPlanRequest);
|
|
@@ -33,4 +33,8 @@ export declare class CyberSecurityRiskManagementRisk extends BaseModel {
|
|
|
33
33
|
confidentiality: number | null;
|
|
34
34
|
integrity: number | null;
|
|
35
35
|
availability: number | null;
|
|
36
|
+
new_control: string | null;
|
|
37
|
+
actual_end_date: Date | null;
|
|
38
|
+
notes: string | null;
|
|
39
|
+
justification_for_delay: string | null;
|
|
36
40
|
}
|
|
@@ -118,6 +118,22 @@ __decorate([
|
|
|
118
118
|
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
119
119
|
__metadata("design:type", Object)
|
|
120
120
|
], CyberSecurityRiskManagementRisk.prototype, "availability", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, typeorm_1.Column)({ type: "text", nullable: true }),
|
|
123
|
+
__metadata("design:type", Object)
|
|
124
|
+
], CyberSecurityRiskManagementRisk.prototype, "new_control", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
127
|
+
__metadata("design:type", Object)
|
|
128
|
+
], CyberSecurityRiskManagementRisk.prototype, "actual_end_date", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, typeorm_1.Column)({ type: "text", nullable: true }),
|
|
131
|
+
__metadata("design:type", Object)
|
|
132
|
+
], CyberSecurityRiskManagementRisk.prototype, "notes", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, typeorm_1.Column)({ type: "text", nullable: true }),
|
|
135
|
+
__metadata("design:type", Object)
|
|
136
|
+
], CyberSecurityRiskManagementRisk.prototype, "justification_for_delay", void 0);
|
|
121
137
|
exports.CyberSecurityRiskManagementRisk = CyberSecurityRiskManagementRisk = __decorate([
|
|
122
138
|
(0, typeorm_1.Entity)({ name: "cyber_security_risk_management_risks" })
|
|
123
139
|
], CyberSecurityRiskManagementRisk);
|
|
@@ -11,60 +11,60 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SlaApprovalsView = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
|
-
const VW_SLA_APPROVALS_SQL = `
|
|
15
|
-
SELECT
|
|
16
|
-
sa.id AS sla_approval_id,
|
|
17
|
-
sa.source_approval_id,
|
|
18
|
-
sa.request_id,
|
|
19
|
-
sa.service_id AS service_id,
|
|
20
|
-
sa.sub_service_id AS sub_service_id,
|
|
21
|
-
TRIM(COALESCE(svc.name, ''))::TEXT AS service_name,
|
|
22
|
-
TRIM(COALESCE(subsvc.sub_service_name, ''))::TEXT AS sub_service_name,
|
|
23
|
-
sa.approver_role_id AS approval_role_id,
|
|
24
|
-
TRIM(COALESCE(ar.name, ''))::TEXT AS approval_role_name,
|
|
25
|
-
sa.department_id AS approval_department_id,
|
|
26
|
-
TRIM(COALESCE(adpt.department_name, ''))::TEXT AS approval_department_name,
|
|
27
|
-
sa.section_id AS approval_section_id,
|
|
28
|
-
TRIM(COALESCE(asec.section_name, ''))::TEXT AS approval_section_name,
|
|
29
|
-
sa.approval_status::TEXT AS approval_status,
|
|
30
|
-
sr.status::TEXT AS request_status,
|
|
31
|
-
sa.level AS level,
|
|
32
|
-
sa.approver_user_id AS approver_user_id,
|
|
33
|
-
TRIM(COALESCE(au.employee_name, ''))::TEXT AS approver_user_name,
|
|
34
|
-
sa.delegate_user_id AS delegate_user_id,
|
|
35
|
-
TRIM(COALESCE(du.employee_name, ''))::TEXT AS delegate_user_name,
|
|
36
|
-
sa.approved_by AS approved_by,
|
|
37
|
-
TRIM(COALESCE(ab.employee_name, ''))::TEXT AS approved_by_name,
|
|
38
|
-
sa.comment::TEXT AS comment,
|
|
39
|
-
sa.created_at AS created_at,
|
|
40
|
-
sa.updated_at AS updated_at
|
|
41
|
-
FROM sla_approval sa
|
|
42
|
-
INNER JOIN sla_requests sr
|
|
43
|
-
ON sr.id = (
|
|
44
|
-
SELECT MIN(sr2.id)
|
|
45
|
-
FROM sla_requests sr2
|
|
46
|
-
WHERE sr2.request_id = sa.request_id
|
|
47
|
-
AND COALESCE(sr2.is_deleted, false) = false
|
|
48
|
-
AND (sa.service_id IS NULL OR sr2.service_id = sa.service_id)
|
|
49
|
-
AND (sa.sub_service_id IS NULL OR sr2.sub_service_id = sa.sub_service_id)
|
|
50
|
-
)
|
|
51
|
-
LEFT JOIN caa_services svc
|
|
52
|
-
ON svc.id = sa.service_id AND COALESCE(svc.is_deleted, false) = false
|
|
53
|
-
LEFT JOIN caa_sub_services subsvc
|
|
54
|
-
ON subsvc.id = sa.sub_service_id AND COALESCE(subsvc.is_deleted, false) = false
|
|
55
|
-
LEFT JOIN departments adpt
|
|
56
|
-
ON adpt.id = sa.department_id AND COALESCE(adpt.is_deleted, false) = false
|
|
57
|
-
LEFT JOIN sections asec
|
|
58
|
-
ON asec.id = sa.section_id AND COALESCE(asec.is_deleted, false) = false
|
|
59
|
-
LEFT JOIN role ar
|
|
60
|
-
ON ar.id = sa.approver_role_id AND COALESCE(ar.is_deleted, false) = false
|
|
61
|
-
LEFT JOIN users au
|
|
62
|
-
ON au.id = sa.approver_user_id AND COALESCE(au.is_deleted, false) = false
|
|
63
|
-
LEFT JOIN users du
|
|
64
|
-
ON du.id = sa.delegate_user_id AND COALESCE(du.is_deleted, false) = false
|
|
65
|
-
LEFT JOIN users ab
|
|
66
|
-
ON ab.id = sa.approved_by AND COALESCE(ab.is_deleted, false) = false
|
|
67
|
-
WHERE COALESCE(sa.is_deleted, false) = false
|
|
14
|
+
const VW_SLA_APPROVALS_SQL = `
|
|
15
|
+
SELECT
|
|
16
|
+
sa.id AS sla_approval_id,
|
|
17
|
+
sa.source_approval_id,
|
|
18
|
+
sa.request_id,
|
|
19
|
+
sa.service_id AS service_id,
|
|
20
|
+
sa.sub_service_id AS sub_service_id,
|
|
21
|
+
TRIM(COALESCE(svc.name, ''))::TEXT AS service_name,
|
|
22
|
+
TRIM(COALESCE(subsvc.sub_service_name, ''))::TEXT AS sub_service_name,
|
|
23
|
+
sa.approver_role_id AS approval_role_id,
|
|
24
|
+
TRIM(COALESCE(ar.name, ''))::TEXT AS approval_role_name,
|
|
25
|
+
sa.department_id AS approval_department_id,
|
|
26
|
+
TRIM(COALESCE(adpt.department_name, ''))::TEXT AS approval_department_name,
|
|
27
|
+
sa.section_id AS approval_section_id,
|
|
28
|
+
TRIM(COALESCE(asec.section_name, ''))::TEXT AS approval_section_name,
|
|
29
|
+
sa.approval_status::TEXT AS approval_status,
|
|
30
|
+
sr.status::TEXT AS request_status,
|
|
31
|
+
sa.level AS level,
|
|
32
|
+
sa.approver_user_id AS approver_user_id,
|
|
33
|
+
TRIM(COALESCE(au.employee_name, ''))::TEXT AS approver_user_name,
|
|
34
|
+
sa.delegate_user_id AS delegate_user_id,
|
|
35
|
+
TRIM(COALESCE(du.employee_name, ''))::TEXT AS delegate_user_name,
|
|
36
|
+
sa.approved_by AS approved_by,
|
|
37
|
+
TRIM(COALESCE(ab.employee_name, ''))::TEXT AS approved_by_name,
|
|
38
|
+
sa.comment::TEXT AS comment,
|
|
39
|
+
sa.created_at AS created_at,
|
|
40
|
+
sa.updated_at AS updated_at
|
|
41
|
+
FROM sla_approval sa
|
|
42
|
+
INNER JOIN sla_requests sr
|
|
43
|
+
ON sr.id = (
|
|
44
|
+
SELECT MIN(sr2.id)
|
|
45
|
+
FROM sla_requests sr2
|
|
46
|
+
WHERE sr2.request_id = sa.request_id
|
|
47
|
+
AND COALESCE(sr2.is_deleted, false) = false
|
|
48
|
+
AND (sa.service_id IS NULL OR sr2.service_id = sa.service_id)
|
|
49
|
+
AND (sa.sub_service_id IS NULL OR sr2.sub_service_id = sa.sub_service_id)
|
|
50
|
+
)
|
|
51
|
+
LEFT JOIN caa_services svc
|
|
52
|
+
ON svc.id = sa.service_id AND COALESCE(svc.is_deleted, false) = false
|
|
53
|
+
LEFT JOIN caa_sub_services subsvc
|
|
54
|
+
ON subsvc.id = sa.sub_service_id AND COALESCE(subsvc.is_deleted, false) = false
|
|
55
|
+
LEFT JOIN departments adpt
|
|
56
|
+
ON adpt.id = sa.department_id AND COALESCE(adpt.is_deleted, false) = false
|
|
57
|
+
LEFT JOIN sections asec
|
|
58
|
+
ON asec.id = sa.section_id AND COALESCE(asec.is_deleted, false) = false
|
|
59
|
+
LEFT JOIN role ar
|
|
60
|
+
ON ar.id = sa.approver_role_id AND COALESCE(ar.is_deleted, false) = false
|
|
61
|
+
LEFT JOIN users au
|
|
62
|
+
ON au.id = sa.approver_user_id AND COALESCE(au.is_deleted, false) = false
|
|
63
|
+
LEFT JOIN users du
|
|
64
|
+
ON du.id = sa.delegate_user_id AND COALESCE(du.is_deleted, false) = false
|
|
65
|
+
LEFT JOIN users ab
|
|
66
|
+
ON ab.id = sa.approved_by AND COALESCE(ab.is_deleted, false) = false
|
|
67
|
+
WHERE COALESCE(sa.is_deleted, false) = false
|
|
68
68
|
`;
|
|
69
69
|
/**
|
|
70
70
|
* Read-only view for SLA approvals listings (TypeORM).
|