@platform-modules/civil-aviation-authority 2.3.311 → 2.3.314
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/models/IconsModel.d.ts +7 -0
- package/dist/models/IconsModel.js +39 -0
- package/dist/models/SlaApprovalsViewModel.js +8 -1
- package/dist/models/SlaMyRequestsViewModel.d.ts +3 -0
- package/dist/models/SlaMyRequestsViewModel.js +22 -2
- package/dist/models/importantLinksModel.d.ts +1 -0
- package/dist/models/importantLinksModel.js +5 -0
- package/package.json +1 -1
- package/sql/add_important_links_icon_id.sql +17 -0
- package/sql/create_icons.sql +21 -0
- package/sql/sla_reports_admin_procedures.sql +1 -2
- package/sql/sla_reports_approvals_workbook.sql +2 -5
- package/sql/sla_reports_procedures.sql +2 -5
- package/sql/vw_sla_approvals.sql +8 -1
- package/sql/vw_sla_my_requests.sql +6 -1
- package/src/data-source.ts +2 -0
- package/src/index.ts +1 -0
- package/src/models/IconsModel.ts +21 -0
- package/src/models/SlaApprovalsViewModel.ts +8 -1
- package/src/models/SlaMyRequestsViewModel.ts +21 -1
- package/src/models/importantLinksModel.ts +4 -0
package/dist/data-source.js
CHANGED
|
@@ -257,6 +257,7 @@ const SlaApprovalsViewModel_1 = require("./models/SlaApprovalsViewModel");
|
|
|
257
257
|
const ServiceSlaApprovalModel_1 = require("./models/ServiceSlaApprovalModel");
|
|
258
258
|
const SlaConfigModel_1 = require("./models/SlaConfigModel");
|
|
259
259
|
const ChatbotQnsAnsMappingModel_1 = require("./models/ChatbotQnsAnsMappingModel");
|
|
260
|
+
const IconsModel_1 = require("./models/IconsModel");
|
|
260
261
|
const CSRMBusinessImpactRatingMasterModel_1 = require("./models/CSRMBusinessImpactRatingMasterModel");
|
|
261
262
|
const CSRMLikelihoodMasterModel_1 = require("./models/CSRMLikelihoodMasterModel");
|
|
262
263
|
const LocationModel_1 = require("./models/LocationModel");
|
|
@@ -581,6 +582,7 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
581
582
|
ServiceSlaApprovalModel_1.ServiceSlaApproval,
|
|
582
583
|
SlaConfigModel_1.SlaConfig,
|
|
583
584
|
ChatbotQnsAnsMappingModel_1.ChatbotQnsAnsMapping,
|
|
585
|
+
IconsModel_1.Icons,
|
|
584
586
|
CSRMBusinessImpactRatingMasterModel_1.CSRMBusinessImpactRatingMaster,
|
|
585
587
|
CSRMLikelihoodMasterModel_1.CSRMLikelihoodMaster,
|
|
586
588
|
LocationModel_1.Location,
|
package/dist/index.d.ts
CHANGED
|
@@ -415,6 +415,7 @@ export * from './models/ContractServiceRequestModel';
|
|
|
415
415
|
export * from './models/ContractServiceRequestDocumentModel';
|
|
416
416
|
export * from './models/SlaConfigModel';
|
|
417
417
|
export * from './models/ChatbotQnsAnsMappingModel';
|
|
418
|
+
export * from './models/IconsModel';
|
|
418
419
|
export * from './models/SlaRequestModel';
|
|
419
420
|
export * from './models/SlaMyRequestsViewModel';
|
|
420
421
|
export * from './models/SlaApprovalsViewModel';
|
package/dist/index.js
CHANGED
|
@@ -604,6 +604,7 @@ __exportStar(require("./models/ContractServiceRequestModel"), exports);
|
|
|
604
604
|
__exportStar(require("./models/ContractServiceRequestDocumentModel"), exports);
|
|
605
605
|
__exportStar(require("./models/SlaConfigModel"), exports);
|
|
606
606
|
__exportStar(require("./models/ChatbotQnsAnsMappingModel"), exports);
|
|
607
|
+
__exportStar(require("./models/IconsModel"), exports);
|
|
607
608
|
__exportStar(require("./models/SlaRequestModel"), exports);
|
|
608
609
|
__exportStar(require("./models/SlaMyRequestsViewModel"), exports);
|
|
609
610
|
__exportStar(require("./models/SlaApprovalsViewModel"), exports);
|
|
@@ -0,0 +1,39 @@
|
|
|
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.Icons = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let Icons = class Icons extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor(icon_name, url) {
|
|
17
|
+
super();
|
|
18
|
+
this.icon_name = icon_name;
|
|
19
|
+
this.url = url;
|
|
20
|
+
this.icon_name_arabic = null;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.Icons = Icons;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: false }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], Icons.prototype, "icon_name", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
30
|
+
__metadata("design:type", Object)
|
|
31
|
+
], Icons.prototype, "icon_name_arabic", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 2000, nullable: false }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], Icons.prototype, "url", void 0);
|
|
36
|
+
exports.Icons = Icons = __decorate([
|
|
37
|
+
(0, typeorm_1.Entity)({ name: "icons" }),
|
|
38
|
+
__metadata("design:paramtypes", [String, String])
|
|
39
|
+
], Icons);
|
|
@@ -40,7 +40,14 @@ SELECT
|
|
|
40
40
|
sa.updated_at AS updated_at
|
|
41
41
|
FROM sla_approval sa
|
|
42
42
|
INNER JOIN sla_requests sr
|
|
43
|
-
ON 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
|
+
)
|
|
44
51
|
LEFT JOIN caa_services svc
|
|
45
52
|
ON svc.id = sa.service_id AND COALESCE(svc.is_deleted, false) = false
|
|
46
53
|
LEFT JOIN caa_sub_services subsvc
|
|
@@ -23,6 +23,9 @@ export declare class SlaMyRequestsView {
|
|
|
23
23
|
request_id: number;
|
|
24
24
|
/** Remaining `request_obj` keys after excluding workflow/common duplicates. */
|
|
25
25
|
request_fields: Record<string, unknown>;
|
|
26
|
+
req_user_arabicname: string;
|
|
27
|
+
req_user_department_arabicname: string;
|
|
28
|
+
req_user_section_arabicname: string;
|
|
26
29
|
}
|
|
27
30
|
/** Flatten view row: fixed columns plus each entry in `request_fields`. */
|
|
28
31
|
export declare function flattenSlaMyRequestsViewRow(row: SlaMyRequestsView): Record<string, unknown>;
|
|
@@ -73,8 +73,13 @@ SELECT
|
|
|
73
73
|
- 'is_deleted'
|
|
74
74
|
- 'sla_request'
|
|
75
75
|
- 'sla_request_id'
|
|
76
|
-
) AS request_fields
|
|
76
|
+
) AS request_fields,
|
|
77
|
+
TRIM(COALESCE(req_owner.employee_arabic_name, ''))::TEXT AS req_user_arabicname,
|
|
78
|
+
TRIM(COALESCE(dept.department_arabic_name, ''))::TEXT AS req_user_department_arabicname,
|
|
79
|
+
TRIM(COALESCE(sec.section_arabic_name, ''))::TEXT AS req_user_section_arabicname
|
|
77
80
|
FROM sla_requests sr
|
|
81
|
+
LEFT JOIN users req_owner
|
|
82
|
+
ON req_owner.id = sr.user_id AND COALESCE(req_owner.is_deleted, false) = false
|
|
78
83
|
LEFT JOIN users creator
|
|
79
84
|
ON creator.id = sr.created_by AND COALESCE(creator.is_deleted, false) = false
|
|
80
85
|
LEFT JOIN departments dept
|
|
@@ -147,6 +152,18 @@ __decorate([
|
|
|
147
152
|
(0, typeorm_1.ViewColumn)(),
|
|
148
153
|
__metadata("design:type", Object)
|
|
149
154
|
], SlaMyRequestsView.prototype, "request_fields", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
(0, typeorm_1.ViewColumn)(),
|
|
157
|
+
__metadata("design:type", String)
|
|
158
|
+
], SlaMyRequestsView.prototype, "req_user_arabicname", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
(0, typeorm_1.ViewColumn)(),
|
|
161
|
+
__metadata("design:type", String)
|
|
162
|
+
], SlaMyRequestsView.prototype, "req_user_department_arabicname", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
(0, typeorm_1.ViewColumn)(),
|
|
165
|
+
__metadata("design:type", String)
|
|
166
|
+
], SlaMyRequestsView.prototype, "req_user_section_arabicname", void 0);
|
|
150
167
|
exports.SlaMyRequestsView = SlaMyRequestsView = __decorate([
|
|
151
168
|
(0, typeorm_1.ViewEntity)({
|
|
152
169
|
name: "vw_sla_my_requests",
|
|
@@ -155,7 +172,7 @@ exports.SlaMyRequestsView = SlaMyRequestsView = __decorate([
|
|
|
155
172
|
], SlaMyRequestsView);
|
|
156
173
|
/** Flatten view row: fixed columns plus each entry in `request_fields`. */
|
|
157
174
|
function flattenSlaMyRequestsViewRow(row) {
|
|
158
|
-
const { sla_request_id, user_id, service_id, sub_service_id, created_by, created_at, req_user_department_id, req_user_section_id, service_name, sub_service_name, status, request_id, request_fields, } = row;
|
|
175
|
+
const { sla_request_id, user_id, service_id, sub_service_id, created_by, created_at, req_user_department_id, req_user_section_id, req_user_arabicname, req_user_department_arabicname, req_user_section_arabicname, service_name, sub_service_name, status, request_id, request_fields, } = row;
|
|
159
176
|
return {
|
|
160
177
|
sla_request_id,
|
|
161
178
|
user_id,
|
|
@@ -165,6 +182,9 @@ function flattenSlaMyRequestsViewRow(row) {
|
|
|
165
182
|
created_at,
|
|
166
183
|
req_user_department_id,
|
|
167
184
|
req_user_section_id,
|
|
185
|
+
req_user_arabicname,
|
|
186
|
+
req_user_department_arabicname,
|
|
187
|
+
req_user_section_arabicname,
|
|
168
188
|
service_name,
|
|
169
189
|
sub_service_name,
|
|
170
190
|
status,
|
|
@@ -17,6 +17,7 @@ let ImportantLinks = class ImportantLinks extends BaseModel_1.BaseModel {
|
|
|
17
17
|
super();
|
|
18
18
|
this.title = title;
|
|
19
19
|
this.url = url;
|
|
20
|
+
this.icon_id = null;
|
|
20
21
|
}
|
|
21
22
|
};
|
|
22
23
|
exports.ImportantLinks = ImportantLinks;
|
|
@@ -28,6 +29,10 @@ __decorate([
|
|
|
28
29
|
(0, typeorm_1.Column)({ type: 'varchar', nullable: false }),
|
|
29
30
|
__metadata("design:type", String)
|
|
30
31
|
], ImportantLinks.prototype, "url", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
34
|
+
__metadata("design:type", Object)
|
|
35
|
+
], ImportantLinks.prototype, "icon_id", void 0);
|
|
31
36
|
exports.ImportantLinks = ImportantLinks = __decorate([
|
|
32
37
|
(0, typeorm_1.Entity)({ name: 'important_links' }),
|
|
33
38
|
__metadata("design:paramtypes", [String, String])
|
package/package.json
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
-- Add icon_id column to important_links table (CAA).
|
|
2
|
+
-- Run once per environment before deploying updated services.
|
|
3
|
+
|
|
4
|
+
ALTER TABLE IF EXISTS important_links
|
|
5
|
+
ADD COLUMN IF NOT EXISTS icon_id INTEGER NULL;
|
|
6
|
+
|
|
7
|
+
CREATE INDEX IF NOT EXISTS idx_important_links_icon_id
|
|
8
|
+
ON important_links (icon_id)
|
|
9
|
+
WHERE is_deleted = FALSE;
|
|
10
|
+
|
|
11
|
+
DO $$ BEGIN
|
|
12
|
+
ALTER TABLE important_links
|
|
13
|
+
ADD CONSTRAINT fk_important_links_icon_id
|
|
14
|
+
FOREIGN KEY (icon_id) REFERENCES icons (id);
|
|
15
|
+
EXCEPTION
|
|
16
|
+
WHEN duplicate_object THEN NULL;
|
|
17
|
+
END $$;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- Icons master table (User Service)
|
|
2
|
+
-- PostgreSQL
|
|
3
|
+
|
|
4
|
+
CREATE TABLE IF NOT EXISTS icons (
|
|
5
|
+
id SERIAL PRIMARY KEY,
|
|
6
|
+
icon_name VARCHAR(255) NOT NULL,
|
|
7
|
+
icon_name_arabic VARCHAR(255) NULL,
|
|
8
|
+
url VARCHAR(2000) NOT NULL,
|
|
9
|
+
created_by INTEGER NULL,
|
|
10
|
+
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
11
|
+
updated_by INTEGER NULL,
|
|
12
|
+
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
13
|
+
is_deleted BOOLEAN DEFAULT FALSE
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
CREATE INDEX IF NOT EXISTS idx_icons_icon_name
|
|
17
|
+
ON icons (LOWER(icon_name))
|
|
18
|
+
WHERE is_deleted = FALSE;
|
|
19
|
+
|
|
20
|
+
CREATE INDEX IF NOT EXISTS idx_icons_is_deleted
|
|
21
|
+
ON icons (is_deleted);
|
|
@@ -57,7 +57,7 @@ DECLARE
|
|
|
57
57
|
v_dyn_keys TEXT[];
|
|
58
58
|
v_dyn_labels TEXT[];
|
|
59
59
|
v_common_labels TEXT[] := ARRAY[
|
|
60
|
-
'
|
|
60
|
+
'Request ID', 'User', 'Status', 'Created At',
|
|
61
61
|
'Created By', 'Department', 'Section'
|
|
62
62
|
];
|
|
63
63
|
v_headers_labels TEXT[];
|
|
@@ -168,7 +168,6 @@ BEGIN
|
|
|
168
168
|
USING p_statuses, p_service_ids, p_sub_service_ids, p_from_date, p_to_date, p_search_text
|
|
169
169
|
LOOP
|
|
170
170
|
v_cells := ARRAY[
|
|
171
|
-
COALESCE(v_row.sla_request_id::TEXT, ''),
|
|
172
171
|
COALESCE(v_row.request_id::TEXT, ''),
|
|
173
172
|
COALESCE(v_row.user_name, ''),
|
|
174
173
|
COALESCE(v_row.status, ''),
|
|
@@ -180,12 +180,12 @@ DECLARE
|
|
|
180
180
|
v_dyn_keys TEXT[];
|
|
181
181
|
v_dyn_labels TEXT[];
|
|
182
182
|
v_common_req_labels TEXT[] := ARRAY[
|
|
183
|
-
'
|
|
183
|
+
'Request ID', 'User', 'Status', 'Created At',
|
|
184
184
|
'Created By', 'Department', 'Section'
|
|
185
185
|
];
|
|
186
186
|
v_approval_headers TEXT[] := ARRAY[
|
|
187
187
|
'Request ID', 'Service ID', 'Service Name', 'Sub Service ID', 'Sub Service Name',
|
|
188
|
-
'
|
|
188
|
+
'Level', 'Approval Status', 'Request Status',
|
|
189
189
|
'Approval Role ID', 'Approval Role Name', 'Approval Department ID', 'Approval Department Name',
|
|
190
190
|
'Approval Section ID', 'Approval Section Name',
|
|
191
191
|
'Approver User ID', 'Approver User Name', 'Delegate User ID', 'Delegate User Name',
|
|
@@ -292,7 +292,6 @@ BEGIN
|
|
|
292
292
|
USING p_request_statuses, p_service_ids, p_sub_service_ids, p_from_date, p_to_date, p_search_text
|
|
293
293
|
LOOP
|
|
294
294
|
v_cells := ARRAY[
|
|
295
|
-
COALESCE(v_row.sla_request_id::TEXT, ''),
|
|
296
295
|
COALESCE(v_row.request_id::TEXT, ''),
|
|
297
296
|
COALESCE(v_row.user_name, ''),
|
|
298
297
|
COALESCE(v_row.status, ''),
|
|
@@ -394,8 +393,6 @@ BEGIN
|
|
|
394
393
|
COALESCE(v_approval.service_name, ''),
|
|
395
394
|
COALESCE(v_approval.sub_service_id::TEXT, ''),
|
|
396
395
|
COALESCE(v_approval.sub_service_name, ''),
|
|
397
|
-
COALESCE(v_approval.sla_approval_id::TEXT, ''),
|
|
398
|
-
COALESCE(v_approval.source_approval_id::TEXT, ''),
|
|
399
396
|
COALESCE(v_approval.level::TEXT, ''),
|
|
400
397
|
COALESCE(v_approval.approval_status, ''),
|
|
401
398
|
COALESCE(v_approval.request_status, ''),
|
|
@@ -574,7 +574,7 @@ DECLARE
|
|
|
574
574
|
v_sheet_label TEXT;
|
|
575
575
|
v_headers_labels TEXT[] := ARRAY[
|
|
576
576
|
'Request ID', 'Service ID', 'Service Name', 'Sub Service ID', 'Sub Service Name',
|
|
577
|
-
'
|
|
577
|
+
'Level', 'Approval Status', 'Request Status',
|
|
578
578
|
'Approval Role ID', 'Approval Role Name', 'Approval Department ID', 'Approval Department Name',
|
|
579
579
|
'Approval Section ID', 'Approval Section Name',
|
|
580
580
|
'Approver User ID', 'Approver User Name', 'Delegate User ID', 'Delegate User Name',
|
|
@@ -661,8 +661,6 @@ BEGIN
|
|
|
661
661
|
COALESCE(v_approval.service_name, ''),
|
|
662
662
|
COALESCE(v_approval.sub_service_id::TEXT, ''),
|
|
663
663
|
COALESCE(v_approval.sub_service_name, ''),
|
|
664
|
-
COALESCE(v_approval.sla_approval_id::TEXT, ''),
|
|
665
|
-
COALESCE(v_approval.source_approval_id::TEXT, ''),
|
|
666
664
|
COALESCE(v_approval.level::TEXT, ''),
|
|
667
665
|
COALESCE(v_approval.approval_status, ''),
|
|
668
666
|
COALESCE(v_approval.request_status, ''),
|
|
@@ -733,7 +731,7 @@ DECLARE
|
|
|
733
731
|
v_dyn_keys TEXT[];
|
|
734
732
|
v_dyn_labels TEXT[];
|
|
735
733
|
v_common_labels TEXT[] := ARRAY[
|
|
736
|
-
'
|
|
734
|
+
'Request ID', 'User', 'Status', 'Created At',
|
|
737
735
|
'Created By', 'Department', 'Section'
|
|
738
736
|
];
|
|
739
737
|
v_headers_labels TEXT[];
|
|
@@ -839,7 +837,6 @@ BEGIN
|
|
|
839
837
|
USING p_statuses, p_service_ids, p_sub_service_ids, p_from_date, p_to_date, p_search_text
|
|
840
838
|
LOOP
|
|
841
839
|
v_cells := ARRAY[
|
|
842
|
-
COALESCE(v_row.sla_request_id::TEXT, ''),
|
|
843
840
|
COALESCE(v_row.request_id::TEXT, ''),
|
|
844
841
|
COALESCE(v_row.user_name, ''),
|
|
845
842
|
COALESCE(v_row.status, ''),
|
package/sql/vw_sla_approvals.sql
CHANGED
|
@@ -70,7 +70,14 @@ FROM sla_approval sa
|
|
|
70
70
|
|
|
71
71
|
INNER JOIN sla_requests sr
|
|
72
72
|
|
|
73
|
-
ON sr.
|
|
73
|
+
ON sr.id = (
|
|
74
|
+
SELECT MIN(sr2.id)
|
|
75
|
+
FROM sla_requests sr2
|
|
76
|
+
WHERE sr2.request_id = sa.request_id
|
|
77
|
+
AND COALESCE(sr2.is_deleted, false) = false
|
|
78
|
+
AND (sa.service_id IS NULL OR sr2.service_id = sa.service_id)
|
|
79
|
+
AND (sa.sub_service_id IS NULL OR sr2.sub_service_id = sa.sub_service_id)
|
|
80
|
+
)
|
|
74
81
|
|
|
75
82
|
LEFT JOIN caa_services svc
|
|
76
83
|
|
|
@@ -38,8 +38,13 @@ SELECT
|
|
|
38
38
|
- 'is_deleted'
|
|
39
39
|
- 'sla_request'
|
|
40
40
|
- 'sla_request_id'
|
|
41
|
-
) AS request_fields
|
|
41
|
+
) AS request_fields,
|
|
42
|
+
TRIM(COALESCE(req_owner.employee_arabic_name, ''))::TEXT AS req_user_arabicname,
|
|
43
|
+
TRIM(COALESCE(dept.department_arabic_name, ''))::TEXT AS req_user_department_arabicname,
|
|
44
|
+
TRIM(COALESCE(sec.section_arabic_name, ''))::TEXT AS req_user_section_arabicname
|
|
42
45
|
FROM sla_requests sr
|
|
46
|
+
LEFT JOIN users req_owner
|
|
47
|
+
ON req_owner.id = sr.user_id AND COALESCE(req_owner.is_deleted, false) = false
|
|
43
48
|
LEFT JOIN users creator
|
|
44
49
|
ON creator.id = sr.created_by AND COALESCE(creator.is_deleted, false) = false
|
|
45
50
|
LEFT JOIN departments dept
|
package/src/data-source.ts
CHANGED
|
@@ -255,6 +255,7 @@ import { SlaApprovalsView } from './models/SlaApprovalsViewModel';
|
|
|
255
255
|
import { ServiceSlaApproval } from './models/ServiceSlaApprovalModel';
|
|
256
256
|
import { SlaConfig } from './models/SlaConfigModel';
|
|
257
257
|
import { ChatbotQnsAnsMapping } from './models/ChatbotQnsAnsMappingModel';
|
|
258
|
+
import { Icons } from './models/IconsModel';
|
|
258
259
|
import { CSRMBusinessImpactRatingMaster } from './models/CSRMBusinessImpactRatingMasterModel';
|
|
259
260
|
import { CSRMLikelihoodMaster } from './models/CSRMLikelihoodMasterModel';
|
|
260
261
|
import { Location } from './models/LocationModel';
|
|
@@ -581,6 +582,7 @@ export const AppDataSource = new DataSource({
|
|
|
581
582
|
ServiceSlaApproval,
|
|
582
583
|
SlaConfig,
|
|
583
584
|
ChatbotQnsAnsMapping,
|
|
585
|
+
Icons,
|
|
584
586
|
CSRMBusinessImpactRatingMaster,
|
|
585
587
|
CSRMLikelihoodMaster,
|
|
586
588
|
Location,
|
package/src/index.ts
CHANGED
|
@@ -505,6 +505,7 @@ export * from './models/ContractServiceRequestModel';
|
|
|
505
505
|
export * from './models/ContractServiceRequestDocumentModel';
|
|
506
506
|
export * from './models/SlaConfigModel';
|
|
507
507
|
export * from './models/ChatbotQnsAnsMappingModel';
|
|
508
|
+
export * from './models/IconsModel';
|
|
508
509
|
export * from './models/SlaRequestModel';
|
|
509
510
|
export * from './models/SlaMyRequestsViewModel';
|
|
510
511
|
export * from './models/SlaApprovalsViewModel';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
@Entity({ name: "icons" })
|
|
5
|
+
export class Icons extends BaseModel {
|
|
6
|
+
@Column({ type: "varchar", length: 255, nullable: false })
|
|
7
|
+
icon_name: string;
|
|
8
|
+
|
|
9
|
+
@Column({ type: "varchar", length: 255, nullable: true })
|
|
10
|
+
icon_name_arabic: string | null;
|
|
11
|
+
|
|
12
|
+
@Column({ type: "varchar", length: 2000, nullable: false })
|
|
13
|
+
url: string;
|
|
14
|
+
|
|
15
|
+
constructor(icon_name: string, url: string) {
|
|
16
|
+
super();
|
|
17
|
+
this.icon_name = icon_name;
|
|
18
|
+
this.url = url;
|
|
19
|
+
this.icon_name_arabic = null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -29,7 +29,14 @@ SELECT
|
|
|
29
29
|
sa.updated_at AS updated_at
|
|
30
30
|
FROM sla_approval sa
|
|
31
31
|
INNER JOIN sla_requests sr
|
|
32
|
-
ON sr.
|
|
32
|
+
ON sr.id = (
|
|
33
|
+
SELECT MIN(sr2.id)
|
|
34
|
+
FROM sla_requests sr2
|
|
35
|
+
WHERE sr2.request_id = sa.request_id
|
|
36
|
+
AND COALESCE(sr2.is_deleted, false) = false
|
|
37
|
+
AND (sa.service_id IS NULL OR sr2.service_id = sa.service_id)
|
|
38
|
+
AND (sa.sub_service_id IS NULL OR sr2.sub_service_id = sa.sub_service_id)
|
|
39
|
+
)
|
|
33
40
|
LEFT JOIN caa_services svc
|
|
34
41
|
ON svc.id = sa.service_id AND COALESCE(svc.is_deleted, false) = false
|
|
35
42
|
LEFT JOIN caa_sub_services subsvc
|
|
@@ -62,8 +62,13 @@ SELECT
|
|
|
62
62
|
- 'is_deleted'
|
|
63
63
|
- 'sla_request'
|
|
64
64
|
- 'sla_request_id'
|
|
65
|
-
) AS request_fields
|
|
65
|
+
) AS request_fields,
|
|
66
|
+
TRIM(COALESCE(req_owner.employee_arabic_name, ''))::TEXT AS req_user_arabicname,
|
|
67
|
+
TRIM(COALESCE(dept.department_arabic_name, ''))::TEXT AS req_user_department_arabicname,
|
|
68
|
+
TRIM(COALESCE(sec.section_arabic_name, ''))::TEXT AS req_user_section_arabicname
|
|
66
69
|
FROM sla_requests sr
|
|
70
|
+
LEFT JOIN users req_owner
|
|
71
|
+
ON req_owner.id = sr.user_id AND COALESCE(req_owner.is_deleted, false) = false
|
|
67
72
|
LEFT JOIN users creator
|
|
68
73
|
ON creator.id = sr.created_by AND COALESCE(creator.is_deleted, false) = false
|
|
69
74
|
LEFT JOIN departments dept
|
|
@@ -129,6 +134,15 @@ export class SlaMyRequestsView {
|
|
|
129
134
|
/** Remaining `request_obj` keys after excluding workflow/common duplicates. */
|
|
130
135
|
@ViewColumn()
|
|
131
136
|
request_fields: Record<string, unknown>;
|
|
137
|
+
|
|
138
|
+
@ViewColumn()
|
|
139
|
+
req_user_arabicname: string;
|
|
140
|
+
|
|
141
|
+
@ViewColumn()
|
|
142
|
+
req_user_department_arabicname: string;
|
|
143
|
+
|
|
144
|
+
@ViewColumn()
|
|
145
|
+
req_user_section_arabicname: string;
|
|
132
146
|
}
|
|
133
147
|
|
|
134
148
|
/** Flatten view row: fixed columns plus each entry in `request_fields`. */
|
|
@@ -144,6 +158,9 @@ export function flattenSlaMyRequestsViewRow(
|
|
|
144
158
|
created_at,
|
|
145
159
|
req_user_department_id,
|
|
146
160
|
req_user_section_id,
|
|
161
|
+
req_user_arabicname,
|
|
162
|
+
req_user_department_arabicname,
|
|
163
|
+
req_user_section_arabicname,
|
|
147
164
|
service_name,
|
|
148
165
|
sub_service_name,
|
|
149
166
|
status,
|
|
@@ -160,6 +177,9 @@ export function flattenSlaMyRequestsViewRow(
|
|
|
160
177
|
created_at,
|
|
161
178
|
req_user_department_id,
|
|
162
179
|
req_user_section_id,
|
|
180
|
+
req_user_arabicname,
|
|
181
|
+
req_user_department_arabicname,
|
|
182
|
+
req_user_section_arabicname,
|
|
163
183
|
service_name,
|
|
164
184
|
sub_service_name,
|
|
165
185
|
status,
|
|
@@ -10,6 +10,9 @@ export class ImportantLinks extends BaseModel {
|
|
|
10
10
|
@Column({ type: 'varchar', nullable: false })
|
|
11
11
|
url: string;
|
|
12
12
|
|
|
13
|
+
@Column({ type: 'integer', nullable: true })
|
|
14
|
+
icon_id: number | null;
|
|
15
|
+
|
|
13
16
|
constructor(
|
|
14
17
|
title: string,
|
|
15
18
|
url: string
|
|
@@ -17,6 +20,7 @@ export class ImportantLinks extends BaseModel {
|
|
|
17
20
|
super();
|
|
18
21
|
this.title = title;
|
|
19
22
|
this.url = url;
|
|
23
|
+
this.icon_id = null;
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
|