@platform-modules/civil-aviation-authority 2.3.305 → 2.3.307
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/i18n/workflow-chat-i18n.json +4 -0
- package/dist/i18n/workflow-chat-message.builder.d.ts +11 -0
- package/dist/i18n/workflow-chat-message.builder.js +23 -0
- package/dist/models/FollowUpReportRequestModel.d.ts +1 -0
- package/dist/models/FollowUpReportRequestModel.js +4 -0
- package/package.json +1 -1
- package/sql/caa_api_payload_changes_2026_07.sql +4 -0
- package/src/i18n/workflow-chat-i18n.json +4 -0
- package/src/i18n/workflow-chat-message.builder.ts +43 -0
- package/src/models/FollowUpReportRequestModel.ts +3 -0
|
@@ -214,6 +214,10 @@
|
|
|
214
214
|
"en": "Request Received",
|
|
215
215
|
"ar": "تم استلام الطلب"
|
|
216
216
|
},
|
|
217
|
+
"request_received_by_role": {
|
|
218
|
+
"en": "Request Received by {{roleName}}",
|
|
219
|
+
"ar": "تم استلام الطلب من قبل {{roleName}}"
|
|
220
|
+
},
|
|
217
221
|
"request_assigned_by_role": {
|
|
218
222
|
"en": "Request assigned by {{roleName}}{{comment}}",
|
|
219
223
|
"ar": "تم تعيين الطلب من قبل {{roleName}}{{comment}}"
|
|
@@ -80,6 +80,17 @@ export declare function buildSynchronizedWorkflowMessage(ctx: WorkflowMessageCon
|
|
|
80
80
|
* Use for every chat insert/update across all CAA modules.
|
|
81
81
|
*/
|
|
82
82
|
export declare function buildSynchronizedChatMessage(ctx: ChatMessageContext): BilingualText;
|
|
83
|
+
/** Chat row: "Request Received by {{roleName}}" with Arabic role name when available. */
|
|
84
|
+
export declare function buildRequestReceivedByRoleChatMessage(params: {
|
|
85
|
+
roleName: string;
|
|
86
|
+
roleArabicName?: string | null;
|
|
87
|
+
}): BilingualText;
|
|
88
|
+
/** Chat row: "Request assigned by {{roleName}}" with optional ". Comment: ..." suffix. */
|
|
89
|
+
export declare function buildAssignmentByRoleChatMessage(params: {
|
|
90
|
+
roleName: string;
|
|
91
|
+
roleArabicName?: string | null;
|
|
92
|
+
comment?: string | null;
|
|
93
|
+
}): BilingualText;
|
|
83
94
|
export type RequestApprovedAssignedWorkflowParams = {
|
|
84
95
|
assignedUserName: string;
|
|
85
96
|
roleName: string;
|
|
@@ -24,6 +24,8 @@ exports.buildAssignTasksEmpPendingWorkflowFields = buildAssignTasksEmpPendingWor
|
|
|
24
24
|
exports.chatTemplate = chatTemplate;
|
|
25
25
|
exports.buildSynchronizedWorkflowMessage = buildSynchronizedWorkflowMessage;
|
|
26
26
|
exports.buildSynchronizedChatMessage = buildSynchronizedChatMessage;
|
|
27
|
+
exports.buildRequestReceivedByRoleChatMessage = buildRequestReceivedByRoleChatMessage;
|
|
28
|
+
exports.buildAssignmentByRoleChatMessage = buildAssignmentByRoleChatMessage;
|
|
27
29
|
exports.tryParseRequestAssignedComment = tryParseRequestAssignedComment;
|
|
28
30
|
exports.buildRequestApprovedAssignedWorkflowFields = buildRequestApprovedAssignedWorkflowFields;
|
|
29
31
|
exports.buildWorkflowLogUpdateFields = buildWorkflowLogUpdateFields;
|
|
@@ -315,6 +317,19 @@ function buildSynchronizedChatMessage(ctx) {
|
|
|
315
317
|
return chatTemplate('request_received');
|
|
316
318
|
}
|
|
317
319
|
}
|
|
320
|
+
/** Chat row: "Request Received by {{roleName}}" with Arabic role name when available. */
|
|
321
|
+
function buildRequestReceivedByRoleChatMessage(params) {
|
|
322
|
+
const roleEn = params.roleName?.trim() || 'Approver';
|
|
323
|
+
const roleAr = resolveBilingualName(roleEn, params.roleArabicName);
|
|
324
|
+
return renderSynchronizedChatMessage('request_received_by_role', { roleName: roleEn }, { roleName: roleAr });
|
|
325
|
+
}
|
|
326
|
+
/** Chat row: "Request assigned by {{roleName}}" with optional ". Comment: ..." suffix. */
|
|
327
|
+
function buildAssignmentByRoleChatMessage(params) {
|
|
328
|
+
const roleEn = params.roleName?.trim() || 'Unknown Role';
|
|
329
|
+
const roleAr = resolveBilingualName(roleEn, params.roleArabicName);
|
|
330
|
+
const commentSuffix = params.comment?.trim() ? `. Comment: ${params.comment.trim()}` : '';
|
|
331
|
+
return renderSynchronizedChatMessage('request_assigned_by_role', { roleName: roleEn, comment: commentSuffix }, { roleName: roleAr, comment: commentSuffix });
|
|
332
|
+
}
|
|
318
333
|
/** Parse legacy English-only assignment comments used as workflow log suffixes. */
|
|
319
334
|
function parseRequestAssignedCommentText(text) {
|
|
320
335
|
const normalized = text.trim();
|
|
@@ -1392,6 +1407,14 @@ function resolveChatMessageAr(message, actors) {
|
|
|
1392
1407
|
continue;
|
|
1393
1408
|
return interpolate(tpl.ar, buildArabicChatTemplateParams(params, actors));
|
|
1394
1409
|
}
|
|
1410
|
+
const receivedByPrefix = 'Request Received by ';
|
|
1411
|
+
if (normalized.startsWith(receivedByPrefix)) {
|
|
1412
|
+
const rolePartEn = normalized.slice(receivedByPrefix.length).trim();
|
|
1413
|
+
if (rolePartEn) {
|
|
1414
|
+
const roleAr = resolveBilingualName(rolePartEn, actors?.roleArabicName);
|
|
1415
|
+
return renderSynchronizedChatMessage('request_received_by_role', { roleName: rolePartEn }, { roleName: roleAr }).ar;
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1395
1418
|
return null;
|
|
1396
1419
|
}
|
|
1397
1420
|
/** True when message matches a known system chat template (safe to resolve message_ar). */
|
|
@@ -40,6 +40,7 @@ export declare class FollowUpReportRequests extends BaseModel {
|
|
|
40
40
|
subject_classification: FollowUpReportSubjectClassification;
|
|
41
41
|
topic: string;
|
|
42
42
|
concerned_department: FollowUpReportConcernedDepartment;
|
|
43
|
+
relevant_department: string | null;
|
|
43
44
|
date_from: Date;
|
|
44
45
|
date_to: Date;
|
|
45
46
|
general_manager_comment: string | null;
|
|
@@ -101,6 +101,10 @@ __decorate([
|
|
|
101
101
|
}),
|
|
102
102
|
__metadata("design:type", String)
|
|
103
103
|
], FollowUpReportRequests.prototype, "concerned_department", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
106
|
+
__metadata("design:type", Object)
|
|
107
|
+
], FollowUpReportRequests.prototype, "relevant_department", void 0);
|
|
104
108
|
__decorate([
|
|
105
109
|
(0, typeorm_1.Column)({ type: 'date', nullable: false }),
|
|
106
110
|
__metadata("design:type", Date)
|
package/package.json
CHANGED
|
@@ -143,3 +143,7 @@ ALTER TABLE followup_report_items
|
|
|
143
143
|
-- 10. Departments: optional parent DG department reference (self FK to departments.id)
|
|
144
144
|
ALTER TABLE departments
|
|
145
145
|
ADD COLUMN IF NOT EXISTS "DG_department_id" INTEGER NULL;
|
|
146
|
+
|
|
147
|
+
-- 11. Follow-up report requests: optional relevant department
|
|
148
|
+
ALTER TABLE followup_report_requests
|
|
149
|
+
ADD COLUMN IF NOT EXISTS relevant_department VARCHAR(255) NULL;
|
|
@@ -214,6 +214,10 @@
|
|
|
214
214
|
"en": "Request Received",
|
|
215
215
|
"ar": "تم استلام الطلب"
|
|
216
216
|
},
|
|
217
|
+
"request_received_by_role": {
|
|
218
|
+
"en": "Request Received by {{roleName}}",
|
|
219
|
+
"ar": "تم استلام الطلب من قبل {{roleName}}"
|
|
220
|
+
},
|
|
217
221
|
"request_assigned_by_role": {
|
|
218
222
|
"en": "Request assigned by {{roleName}}{{comment}}",
|
|
219
223
|
"ar": "تم تعيين الطلب من قبل {{roleName}}{{comment}}"
|
|
@@ -456,6 +456,36 @@ export function buildSynchronizedChatMessage(ctx: ChatMessageContext): Bilingual
|
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
|
|
459
|
+
/** Chat row: "Request Received by {{roleName}}" with Arabic role name when available. */
|
|
460
|
+
export function buildRequestReceivedByRoleChatMessage(params: {
|
|
461
|
+
roleName: string;
|
|
462
|
+
roleArabicName?: string | null;
|
|
463
|
+
}): BilingualText {
|
|
464
|
+
const roleEn = params.roleName?.trim() || 'Approver';
|
|
465
|
+
const roleAr = resolveBilingualName(roleEn, params.roleArabicName);
|
|
466
|
+
return renderSynchronizedChatMessage(
|
|
467
|
+
'request_received_by_role',
|
|
468
|
+
{ roleName: roleEn },
|
|
469
|
+
{ roleName: roleAr },
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/** Chat row: "Request assigned by {{roleName}}" with optional ". Comment: ..." suffix. */
|
|
474
|
+
export function buildAssignmentByRoleChatMessage(params: {
|
|
475
|
+
roleName: string;
|
|
476
|
+
roleArabicName?: string | null;
|
|
477
|
+
comment?: string | null;
|
|
478
|
+
}): BilingualText {
|
|
479
|
+
const roleEn = params.roleName?.trim() || 'Unknown Role';
|
|
480
|
+
const roleAr = resolveBilingualName(roleEn, params.roleArabicName);
|
|
481
|
+
const commentSuffix = params.comment?.trim() ? `. Comment: ${params.comment.trim()}` : '';
|
|
482
|
+
return renderSynchronizedChatMessage(
|
|
483
|
+
'request_assigned_by_role',
|
|
484
|
+
{ roleName: roleEn, comment: commentSuffix },
|
|
485
|
+
{ roleName: roleAr, comment: commentSuffix },
|
|
486
|
+
);
|
|
487
|
+
}
|
|
488
|
+
|
|
459
489
|
// ─── Backward-compatible aliases used by Cancellation pilot ───────────────────
|
|
460
490
|
|
|
461
491
|
export type RequestApprovedAssignedWorkflowParams = {
|
|
@@ -2044,6 +2074,19 @@ export function resolveChatMessageAr(
|
|
|
2044
2074
|
return interpolate(tpl.ar, buildArabicChatTemplateParams(params, actors));
|
|
2045
2075
|
}
|
|
2046
2076
|
|
|
2077
|
+
const receivedByPrefix = 'Request Received by ';
|
|
2078
|
+
if (normalized.startsWith(receivedByPrefix)) {
|
|
2079
|
+
const rolePartEn = normalized.slice(receivedByPrefix.length).trim();
|
|
2080
|
+
if (rolePartEn) {
|
|
2081
|
+
const roleAr = resolveBilingualName(rolePartEn, actors?.roleArabicName);
|
|
2082
|
+
return renderSynchronizedChatMessage(
|
|
2083
|
+
'request_received_by_role',
|
|
2084
|
+
{ roleName: rolePartEn },
|
|
2085
|
+
{ roleName: roleAr },
|
|
2086
|
+
).ar;
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2047
2090
|
return null;
|
|
2048
2091
|
}
|
|
2049
2092
|
|
|
@@ -81,6 +81,9 @@ export class FollowUpReportRequests extends BaseModel {
|
|
|
81
81
|
})
|
|
82
82
|
concerned_department: FollowUpReportConcernedDepartment;
|
|
83
83
|
|
|
84
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
85
|
+
relevant_department: string | null;
|
|
86
|
+
|
|
84
87
|
@Column({ type: 'date', nullable: false })
|
|
85
88
|
date_from: Date;
|
|
86
89
|
|