@platform-modules/civil-aviation-authority 2.3.142 → 2.3.146

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.
@@ -160,6 +160,11 @@ const LegalConsultationWorkflowModel_1 = require("./models/LegalConsultationWork
160
160
  const LegalConsultationApprovalModel_1 = require("./models/LegalConsultationApprovalModel");
161
161
  const LegalConsultationChatModel_1 = require("./models/LegalConsultationChatModel");
162
162
  const LegalConsultationAttachmentModel_1 = require("./models/LegalConsultationAttachmentModel");
163
+ const LegalComplaintRequestModel_1 = require("./models/LegalComplaintRequestModel");
164
+ const LegalComplaintWorkflowModel_1 = require("./models/LegalComplaintWorkflowModel");
165
+ const LegalComplaintApprovalModel_1 = require("./models/LegalComplaintApprovalModel");
166
+ const LegalComplaintChatModel_1 = require("./models/LegalComplaintChatModel");
167
+ const LegalComplaintAttachmentModel_1 = require("./models/LegalComplaintAttachmentModel");
163
168
  exports.AppDataSource = new typeorm_1.DataSource({
164
169
  type: 'postgres',
165
170
  host: process.env.DB_HOST || 'localhost',
@@ -316,6 +321,11 @@ exports.AppDataSource = new typeorm_1.DataSource({
316
321
  LegalConsultationApprovalModel_1.LegalConsultationApproval,
317
322
  LegalConsultationChatModel_1.LegalConsultationChat,
318
323
  LegalConsultationAttachmentModel_1.LegalConsultationAttachment,
324
+ LegalComplaintRequestModel_1.LegalComplaintRequest,
325
+ LegalComplaintWorkflowModel_1.LegalComplaintWorkflow,
326
+ LegalComplaintApprovalModel_1.LegalComplaintApproval,
327
+ LegalComplaintChatModel_1.LegalComplaintChat,
328
+ LegalComplaintAttachmentModel_1.LegalComplaintAttachment,
319
329
  DocumentModel_1.Document,
320
330
  DocumentFolderModel_1.DocumentFolder,
321
331
  DocumentDriveModel_1.DocumentDrive,
package/dist/index.d.ts CHANGED
@@ -283,5 +283,10 @@ export * from './models/LegalConsultationWorkflowModel';
283
283
  export * from './models/LegalConsultationApprovalModel';
284
284
  export * from './models/LegalConsultationChatModel';
285
285
  export * from './models/LegalConsultationAttachmentModel';
286
+ export * from './models/LegalComplaintRequestModel';
287
+ export * from './models/LegalComplaintWorkflowModel';
288
+ export * from './models/LegalComplaintApprovalModel';
289
+ export * from './models/LegalComplaintChatModel';
290
+ export * from './models/LegalComplaintAttachmentModel';
286
291
  export * from './models/AssetApartmentTypeModel';
287
292
  export * from './models/AssetUnitLocationModel';
package/dist/index.js CHANGED
@@ -434,6 +434,12 @@ __exportStar(require("./models/LegalConsultationWorkflowModel"), exports);
434
434
  __exportStar(require("./models/LegalConsultationApprovalModel"), exports);
435
435
  __exportStar(require("./models/LegalConsultationChatModel"), exports);
436
436
  __exportStar(require("./models/LegalConsultationAttachmentModel"), exports);
437
+ // Raise a Legal Complaint
438
+ __exportStar(require("./models/LegalComplaintRequestModel"), exports);
439
+ __exportStar(require("./models/LegalComplaintWorkflowModel"), exports);
440
+ __exportStar(require("./models/LegalComplaintApprovalModel"), exports);
441
+ __exportStar(require("./models/LegalComplaintChatModel"), exports);
442
+ __exportStar(require("./models/LegalComplaintAttachmentModel"), exports);
437
443
  // Asset Affairs Admin Configuration
438
444
  __exportStar(require("./models/AssetApartmentTypeModel"), exports);
439
445
  __exportStar(require("./models/AssetUnitLocationModel"), exports);
@@ -0,0 +1,24 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare enum LegalComplaintApprovalStatus {
3
+ PENDING = "Pending",
4
+ IN_PROGRESS = "In Progress",
5
+ APPROVED = "Approved",
6
+ REJECTED = "Rejected",
7
+ REASSIGNED = "Reassigned"
8
+ }
9
+ export declare class LegalComplaintApproval extends BaseModel {
10
+ request_id: number;
11
+ service_id: number;
12
+ sub_service_id: number;
13
+ approver_role_id: number;
14
+ approver_user_id: number;
15
+ delegate_user_id: number;
16
+ approved_by: number;
17
+ department_id: number;
18
+ section_id: number;
19
+ level: number;
20
+ approval_status: LegalComplaintApprovalStatus;
21
+ comment: string;
22
+ created_by: number;
23
+ constructor();
24
+ }
@@ -0,0 +1,89 @@
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.LegalComplaintApproval = exports.LegalComplaintApprovalStatus = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ var LegalComplaintApprovalStatus;
16
+ (function (LegalComplaintApprovalStatus) {
17
+ LegalComplaintApprovalStatus["PENDING"] = "Pending";
18
+ LegalComplaintApprovalStatus["IN_PROGRESS"] = "In Progress";
19
+ LegalComplaintApprovalStatus["APPROVED"] = "Approved";
20
+ LegalComplaintApprovalStatus["REJECTED"] = "Rejected";
21
+ LegalComplaintApprovalStatus["REASSIGNED"] = "Reassigned";
22
+ })(LegalComplaintApprovalStatus || (exports.LegalComplaintApprovalStatus = LegalComplaintApprovalStatus = {}));
23
+ let LegalComplaintApproval = class LegalComplaintApproval extends BaseModel_1.BaseModel {
24
+ constructor() {
25
+ super();
26
+ }
27
+ };
28
+ exports.LegalComplaintApproval = LegalComplaintApproval;
29
+ __decorate([
30
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
31
+ __metadata("design:type", Number)
32
+ ], LegalComplaintApproval.prototype, "request_id", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
35
+ __metadata("design:type", Number)
36
+ ], LegalComplaintApproval.prototype, "service_id", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
39
+ __metadata("design:type", Number)
40
+ ], LegalComplaintApproval.prototype, "sub_service_id", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
43
+ __metadata("design:type", Number)
44
+ ], LegalComplaintApproval.prototype, "approver_role_id", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
47
+ __metadata("design:type", Number)
48
+ ], LegalComplaintApproval.prototype, "approver_user_id", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
51
+ __metadata("design:type", Number)
52
+ ], LegalComplaintApproval.prototype, "delegate_user_id", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
55
+ __metadata("design:type", Number)
56
+ ], LegalComplaintApproval.prototype, "approved_by", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
59
+ __metadata("design:type", Number)
60
+ ], LegalComplaintApproval.prototype, "department_id", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
63
+ __metadata("design:type", Number)
64
+ ], LegalComplaintApproval.prototype, "section_id", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
67
+ __metadata("design:type", Number)
68
+ ], LegalComplaintApproval.prototype, "level", void 0);
69
+ __decorate([
70
+ (0, typeorm_1.Column)({
71
+ type: 'enum',
72
+ enum: LegalComplaintApprovalStatus,
73
+ default: LegalComplaintApprovalStatus.PENDING,
74
+ nullable: false,
75
+ }),
76
+ __metadata("design:type", String)
77
+ ], LegalComplaintApproval.prototype, "approval_status", void 0);
78
+ __decorate([
79
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
80
+ __metadata("design:type", String)
81
+ ], LegalComplaintApproval.prototype, "comment", void 0);
82
+ __decorate([
83
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
84
+ __metadata("design:type", Number)
85
+ ], LegalComplaintApproval.prototype, "created_by", void 0);
86
+ exports.LegalComplaintApproval = LegalComplaintApproval = __decorate([
87
+ (0, typeorm_1.Entity)({ name: 'legal_complaint_approvals' }),
88
+ __metadata("design:paramtypes", [])
89
+ ], LegalComplaintApproval);
@@ -0,0 +1,15 @@
1
+ import { BaseModel } from './BaseModel';
2
+ /** primary = main upload; supporting = additional evidence */
3
+ export type LegalComplaintAttachmentKind = 'primary' | 'supporting';
4
+ export declare class LegalComplaintAttachment extends BaseModel {
5
+ request_id: number;
6
+ service_id: number;
7
+ sub_service_id: number;
8
+ attachment_kind: string;
9
+ file_name: string;
10
+ file_url: string;
11
+ file_type: string;
12
+ file_size: number;
13
+ created_by: number;
14
+ constructor();
15
+ }
@@ -0,0 +1,60 @@
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.LegalComplaintAttachment = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ let LegalComplaintAttachment = class LegalComplaintAttachment extends BaseModel_1.BaseModel {
16
+ constructor() {
17
+ super();
18
+ }
19
+ };
20
+ exports.LegalComplaintAttachment = LegalComplaintAttachment;
21
+ __decorate([
22
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
23
+ __metadata("design:type", Number)
24
+ ], LegalComplaintAttachment.prototype, "request_id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
27
+ __metadata("design:type", Number)
28
+ ], LegalComplaintAttachment.prototype, "service_id", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
31
+ __metadata("design:type", Number)
32
+ ], LegalComplaintAttachment.prototype, "sub_service_id", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({ type: 'varchar', length: 32, nullable: false, default: 'primary' }),
35
+ __metadata("design:type", String)
36
+ ], LegalComplaintAttachment.prototype, "attachment_kind", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
39
+ __metadata("design:type", String)
40
+ ], LegalComplaintAttachment.prototype, "file_name", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: false }),
43
+ __metadata("design:type", String)
44
+ ], LegalComplaintAttachment.prototype, "file_url", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: false }),
47
+ __metadata("design:type", String)
48
+ ], LegalComplaintAttachment.prototype, "file_type", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
51
+ __metadata("design:type", Number)
52
+ ], LegalComplaintAttachment.prototype, "file_size", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
55
+ __metadata("design:type", Number)
56
+ ], LegalComplaintAttachment.prototype, "created_by", void 0);
57
+ exports.LegalComplaintAttachment = LegalComplaintAttachment = __decorate([
58
+ (0, typeorm_1.Entity)({ name: 'legal_complaint_attachments' }),
59
+ __metadata("design:paramtypes", [])
60
+ ], LegalComplaintAttachment);
@@ -0,0 +1,17 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare enum LegalComplaintMessageType {
3
+ text = "text"
4
+ }
5
+ export declare class LegalComplaintChat extends BaseModel {
6
+ request_id: number;
7
+ service_id: number;
8
+ sub_service_id: number;
9
+ user_id: number;
10
+ approver_role_id: number;
11
+ message: string;
12
+ message_type: string;
13
+ status: string;
14
+ is_internal: boolean;
15
+ created_by: number;
16
+ constructor();
17
+ }
@@ -0,0 +1,68 @@
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.LegalComplaintChat = exports.LegalComplaintMessageType = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ var LegalComplaintMessageType;
16
+ (function (LegalComplaintMessageType) {
17
+ LegalComplaintMessageType["text"] = "text";
18
+ })(LegalComplaintMessageType || (exports.LegalComplaintMessageType = LegalComplaintMessageType = {}));
19
+ let LegalComplaintChat = class LegalComplaintChat extends BaseModel_1.BaseModel {
20
+ constructor() {
21
+ super();
22
+ }
23
+ };
24
+ exports.LegalComplaintChat = LegalComplaintChat;
25
+ __decorate([
26
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
27
+ __metadata("design:type", Number)
28
+ ], LegalComplaintChat.prototype, "request_id", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
31
+ __metadata("design:type", Number)
32
+ ], LegalComplaintChat.prototype, "service_id", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
35
+ __metadata("design:type", Number)
36
+ ], LegalComplaintChat.prototype, "sub_service_id", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
39
+ __metadata("design:type", Number)
40
+ ], LegalComplaintChat.prototype, "user_id", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
43
+ __metadata("design:type", Number)
44
+ ], LegalComplaintChat.prototype, "approver_role_id", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({ type: 'text', nullable: false }),
47
+ __metadata("design:type", String)
48
+ ], LegalComplaintChat.prototype, "message", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: false, default: 'text' }),
51
+ __metadata("design:type", String)
52
+ ], LegalComplaintChat.prototype, "message_type", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
55
+ __metadata("design:type", String)
56
+ ], LegalComplaintChat.prototype, "status", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: false, default: false }),
59
+ __metadata("design:type", Boolean)
60
+ ], LegalComplaintChat.prototype, "is_internal", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
63
+ __metadata("design:type", Number)
64
+ ], LegalComplaintChat.prototype, "created_by", void 0);
65
+ exports.LegalComplaintChat = LegalComplaintChat = __decorate([
66
+ (0, typeorm_1.Entity)({ name: 'legal_complaint_chat' }),
67
+ __metadata("design:paramtypes", [])
68
+ ], LegalComplaintChat);
@@ -0,0 +1,30 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare enum LegalComplaintRequestStatus {
3
+ Pending = "Pending",
4
+ Approved = "Approved",
5
+ Rejected = "Rejected",
6
+ RFC = "RFC"
7
+ }
8
+ export declare class LegalComplaintRequest extends BaseModel {
9
+ complaint_date: Date;
10
+ title: string;
11
+ description: string;
12
+ /** Times, dates, locations, individuals, events, etc. */
13
+ complaint_details: string;
14
+ /** Name / Position / Employee ID / Directorate / Department / Section (structured text or JSON) */
15
+ complainant_details: string;
16
+ /** Subject of complaint: Name / Position / Salary Grade / Directorate / Department / Section */
17
+ complained_employee_details: string;
18
+ req_user_department_id: number | null;
19
+ req_user_section_id: number | null;
20
+ status: string;
21
+ user_id: number;
22
+ workflow_execution_id: string;
23
+ created_by: number;
24
+ approved_by: number;
25
+ approved_at: Date;
26
+ approver_comment: string;
27
+ service_id: number;
28
+ sub_service_id: number;
29
+ constructor();
30
+ }
@@ -0,0 +1,99 @@
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.LegalComplaintRequest = exports.LegalComplaintRequestStatus = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ var LegalComplaintRequestStatus;
16
+ (function (LegalComplaintRequestStatus) {
17
+ LegalComplaintRequestStatus["Pending"] = "Pending";
18
+ LegalComplaintRequestStatus["Approved"] = "Approved";
19
+ LegalComplaintRequestStatus["Rejected"] = "Rejected";
20
+ LegalComplaintRequestStatus["RFC"] = "RFC";
21
+ })(LegalComplaintRequestStatus || (exports.LegalComplaintRequestStatus = LegalComplaintRequestStatus = {}));
22
+ let LegalComplaintRequest = class LegalComplaintRequest extends BaseModel_1.BaseModel {
23
+ constructor() {
24
+ super();
25
+ }
26
+ };
27
+ exports.LegalComplaintRequest = LegalComplaintRequest;
28
+ __decorate([
29
+ (0, typeorm_1.Column)({ type: 'date', nullable: false }),
30
+ __metadata("design:type", Date)
31
+ ], LegalComplaintRequest.prototype, "complaint_date", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: false }),
34
+ __metadata("design:type", String)
35
+ ], LegalComplaintRequest.prototype, "title", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ type: 'text', nullable: false }),
38
+ __metadata("design:type", String)
39
+ ], LegalComplaintRequest.prototype, "description", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ type: 'text', nullable: false }),
42
+ __metadata("design:type", String)
43
+ ], LegalComplaintRequest.prototype, "complaint_details", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ type: 'text', nullable: false }),
46
+ __metadata("design:type", String)
47
+ ], LegalComplaintRequest.prototype, "complainant_details", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({ type: 'text', nullable: false }),
50
+ __metadata("design:type", String)
51
+ ], LegalComplaintRequest.prototype, "complained_employee_details", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
54
+ __metadata("design:type", Object)
55
+ ], LegalComplaintRequest.prototype, "req_user_department_id", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
58
+ __metadata("design:type", Object)
59
+ ], LegalComplaintRequest.prototype, "req_user_section_id", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Column)({ type: 'varchar', length: 20, nullable: false, default: 'Pending' }),
62
+ __metadata("design:type", String)
63
+ ], LegalComplaintRequest.prototype, "status", void 0);
64
+ __decorate([
65
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
66
+ __metadata("design:type", Number)
67
+ ], LegalComplaintRequest.prototype, "user_id", void 0);
68
+ __decorate([
69
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
70
+ __metadata("design:type", String)
71
+ ], LegalComplaintRequest.prototype, "workflow_execution_id", void 0);
72
+ __decorate([
73
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
74
+ __metadata("design:type", Number)
75
+ ], LegalComplaintRequest.prototype, "created_by", void 0);
76
+ __decorate([
77
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
78
+ __metadata("design:type", Number)
79
+ ], LegalComplaintRequest.prototype, "approved_by", void 0);
80
+ __decorate([
81
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
82
+ __metadata("design:type", Date)
83
+ ], LegalComplaintRequest.prototype, "approved_at", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
86
+ __metadata("design:type", String)
87
+ ], LegalComplaintRequest.prototype, "approver_comment", void 0);
88
+ __decorate([
89
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
90
+ __metadata("design:type", Number)
91
+ ], LegalComplaintRequest.prototype, "service_id", void 0);
92
+ __decorate([
93
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
94
+ __metadata("design:type", Number)
95
+ ], LegalComplaintRequest.prototype, "sub_service_id", void 0);
96
+ exports.LegalComplaintRequest = LegalComplaintRequest = __decorate([
97
+ (0, typeorm_1.Entity)({ name: 'legal_complaint_requests' }),
98
+ __metadata("design:paramtypes", [])
99
+ ], LegalComplaintRequest);
@@ -0,0 +1,25 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare enum LegalComplaintWorkFlowStatus {
3
+ Pending = "Pending",
4
+ InProgress = "In Progress",
5
+ Approved = "Approved",
6
+ Rejected = "Rejected",
7
+ RFC = "RFC"
8
+ }
9
+ export declare class LegalComplaintWorkflow extends BaseModel {
10
+ request_id: number;
11
+ service_id: number;
12
+ sub_service_id: number;
13
+ workflow_definition_id: number;
14
+ current_level: number;
15
+ content: string;
16
+ status: string;
17
+ step_order: number;
18
+ user_id: number;
19
+ role_id: number;
20
+ department_id: number;
21
+ section_id: number;
22
+ workflow_data: string;
23
+ created_by: number;
24
+ constructor();
25
+ }
@@ -0,0 +1,88 @@
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.LegalComplaintWorkflow = exports.LegalComplaintWorkFlowStatus = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ var LegalComplaintWorkFlowStatus;
16
+ (function (LegalComplaintWorkFlowStatus) {
17
+ LegalComplaintWorkFlowStatus["Pending"] = "Pending";
18
+ LegalComplaintWorkFlowStatus["InProgress"] = "In Progress";
19
+ LegalComplaintWorkFlowStatus["Approved"] = "Approved";
20
+ LegalComplaintWorkFlowStatus["Rejected"] = "Rejected";
21
+ LegalComplaintWorkFlowStatus["RFC"] = "RFC";
22
+ })(LegalComplaintWorkFlowStatus || (exports.LegalComplaintWorkFlowStatus = LegalComplaintWorkFlowStatus = {}));
23
+ let LegalComplaintWorkflow = class LegalComplaintWorkflow extends BaseModel_1.BaseModel {
24
+ constructor() {
25
+ super();
26
+ }
27
+ };
28
+ exports.LegalComplaintWorkflow = LegalComplaintWorkflow;
29
+ __decorate([
30
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
31
+ __metadata("design:type", Number)
32
+ ], LegalComplaintWorkflow.prototype, "request_id", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
35
+ __metadata("design:type", Number)
36
+ ], LegalComplaintWorkflow.prototype, "service_id", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
39
+ __metadata("design:type", Number)
40
+ ], LegalComplaintWorkflow.prototype, "sub_service_id", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
43
+ __metadata("design:type", Number)
44
+ ], LegalComplaintWorkflow.prototype, "workflow_definition_id", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
47
+ __metadata("design:type", Number)
48
+ ], LegalComplaintWorkflow.prototype, "current_level", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true }),
51
+ __metadata("design:type", String)
52
+ ], LegalComplaintWorkflow.prototype, "content", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: false }),
55
+ __metadata("design:type", String)
56
+ ], LegalComplaintWorkflow.prototype, "status", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
59
+ __metadata("design:type", Number)
60
+ ], LegalComplaintWorkflow.prototype, "step_order", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
63
+ __metadata("design:type", Number)
64
+ ], LegalComplaintWorkflow.prototype, "user_id", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
67
+ __metadata("design:type", Number)
68
+ ], LegalComplaintWorkflow.prototype, "role_id", void 0);
69
+ __decorate([
70
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
71
+ __metadata("design:type", Number)
72
+ ], LegalComplaintWorkflow.prototype, "department_id", void 0);
73
+ __decorate([
74
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
75
+ __metadata("design:type", Number)
76
+ ], LegalComplaintWorkflow.prototype, "section_id", void 0);
77
+ __decorate([
78
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
79
+ __metadata("design:type", String)
80
+ ], LegalComplaintWorkflow.prototype, "workflow_data", void 0);
81
+ __decorate([
82
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
83
+ __metadata("design:type", Number)
84
+ ], LegalComplaintWorkflow.prototype, "created_by", void 0);
85
+ exports.LegalComplaintWorkflow = LegalComplaintWorkflow = __decorate([
86
+ (0, typeorm_1.Entity)({ name: 'legal_complaint_workflow' }),
87
+ __metadata("design:paramtypes", [])
88
+ ], LegalComplaintWorkflow);
@@ -3,7 +3,9 @@ export declare enum LegalConsultationApprovalStatus {
3
3
  PENDING = "Pending",
4
4
  IN_PROGRESS = "In Progress",
5
5
  APPROVED = "Approved",
6
- REJECTED = "Rejected"
6
+ REJECTED = "Rejected",
7
+ /** Current step completed by assigning the next approver (user/dept/section/role). */
8
+ REASSIGNED = "Reassigned"
7
9
  }
8
10
  export declare class LegalConsultationApproval extends BaseModel {
9
11
  request_id: number;
@@ -18,6 +18,8 @@ var LegalConsultationApprovalStatus;
18
18
  LegalConsultationApprovalStatus["IN_PROGRESS"] = "In Progress";
19
19
  LegalConsultationApprovalStatus["APPROVED"] = "Approved";
20
20
  LegalConsultationApprovalStatus["REJECTED"] = "Rejected";
21
+ /** Current step completed by assigning the next approver (user/dept/section/role). */
22
+ LegalConsultationApprovalStatus["REASSIGNED"] = "Reassigned";
21
23
  })(LegalConsultationApprovalStatus || (exports.LegalConsultationApprovalStatus = LegalConsultationApprovalStatus = {}));
22
24
  let LegalConsultationApproval = class LegalConsultationApproval extends BaseModel_1.BaseModel {
23
25
  constructor() {
@@ -6,8 +6,6 @@ export declare enum LegalConsultationRequestStatus {
6
6
  RFC = "RFC"
7
7
  }
8
8
  export declare class LegalConsultationRequest extends BaseModel {
9
- /** Business reference (populated by create worker / workflow) */
10
- request_id: string | null;
11
9
  request_date: Date;
12
10
  title: string;
13
11
  description: string;
@@ -25,10 +25,6 @@ let LegalConsultationRequest = class LegalConsultationRequest extends BaseModel_
25
25
  }
26
26
  };
27
27
  exports.LegalConsultationRequest = LegalConsultationRequest;
28
- __decorate([
29
- (0, typeorm_1.Column)({ type: 'varchar', length: 20, nullable: true }),
30
- __metadata("design:type", Object)
31
- ], LegalConsultationRequest.prototype, "request_id", void 0);
32
28
  __decorate([
33
29
  (0, typeorm_1.Column)({ type: 'date', nullable: false }),
34
30
  __metadata("design:type", Date)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/civil-aviation-authority",
3
- "version": "2.3.142",
3
+ "version": "2.3.146",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -158,6 +158,11 @@ import { LegalConsultationWorkflow } from './models/LegalConsultationWorkflowMod
158
158
  import { LegalConsultationApproval } from './models/LegalConsultationApprovalModel';
159
159
  import { LegalConsultationChat } from './models/LegalConsultationChatModel';
160
160
  import { LegalConsultationAttachment } from './models/LegalConsultationAttachmentModel';
161
+ import { LegalComplaintRequest } from './models/LegalComplaintRequestModel';
162
+ import { LegalComplaintWorkflow } from './models/LegalComplaintWorkflowModel';
163
+ import { LegalComplaintApproval } from './models/LegalComplaintApprovalModel';
164
+ import { LegalComplaintChat } from './models/LegalComplaintChatModel';
165
+ import { LegalComplaintAttachment } from './models/LegalComplaintAttachmentModel';
161
166
 
162
167
  export const AppDataSource = new DataSource({
163
168
  type: 'postgres',
@@ -315,6 +320,11 @@ export const AppDataSource = new DataSource({
315
320
  LegalConsultationApproval,
316
321
  LegalConsultationChat,
317
322
  LegalConsultationAttachment,
323
+ LegalComplaintRequest,
324
+ LegalComplaintWorkflow,
325
+ LegalComplaintApproval,
326
+ LegalComplaintChat,
327
+ LegalComplaintAttachment,
318
328
  Document,
319
329
  DocumentFolder,
320
330
  DocumentDrive,
package/src/index.ts CHANGED
@@ -350,6 +350,13 @@ export * from './models/LegalConsultationApprovalModel';
350
350
  export * from './models/LegalConsultationChatModel';
351
351
  export * from './models/LegalConsultationAttachmentModel';
352
352
 
353
+ // Raise a Legal Complaint
354
+ export * from './models/LegalComplaintRequestModel';
355
+ export * from './models/LegalComplaintWorkflowModel';
356
+ export * from './models/LegalComplaintApprovalModel';
357
+ export * from './models/LegalComplaintChatModel';
358
+ export * from './models/LegalComplaintAttachmentModel';
359
+
353
360
  // Asset Affairs Admin Configuration
354
361
  export * from './models/AssetApartmentTypeModel';
355
362
  export * from './models/AssetUnitLocationModel';
@@ -0,0 +1,61 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum LegalComplaintApprovalStatus {
5
+ PENDING = 'Pending',
6
+ IN_PROGRESS = 'In Progress',
7
+ APPROVED = 'Approved',
8
+ REJECTED = 'Rejected',
9
+ REASSIGNED = 'Reassigned',
10
+ }
11
+
12
+ @Entity({ name: 'legal_complaint_approvals' })
13
+ export class LegalComplaintApproval extends BaseModel {
14
+ @Column({ type: 'int', nullable: false })
15
+ request_id: number;
16
+
17
+ @Column({ type: 'int', nullable: false })
18
+ service_id: number;
19
+
20
+ @Column({ type: 'int', nullable: false })
21
+ sub_service_id: number;
22
+
23
+ @Column({ type: 'int', nullable: true })
24
+ approver_role_id: number;
25
+
26
+ @Column({ type: 'int', nullable: true })
27
+ approver_user_id: number;
28
+
29
+ @Column({ type: 'int', nullable: true })
30
+ delegate_user_id: number;
31
+
32
+ @Column({ type: 'int', nullable: true })
33
+ approved_by: number;
34
+
35
+ @Column({ type: 'int', nullable: true })
36
+ department_id: number;
37
+
38
+ @Column({ type: 'int', nullable: true })
39
+ section_id: number;
40
+
41
+ @Column({ type: 'int', nullable: false })
42
+ level: number;
43
+
44
+ @Column({
45
+ type: 'enum',
46
+ enum: LegalComplaintApprovalStatus,
47
+ default: LegalComplaintApprovalStatus.PENDING,
48
+ nullable: false,
49
+ })
50
+ approval_status: LegalComplaintApprovalStatus;
51
+
52
+ @Column({ type: 'text', nullable: true })
53
+ comment: string;
54
+
55
+ @Column({ type: 'int', nullable: false })
56
+ created_by: number;
57
+
58
+ constructor() {
59
+ super();
60
+ }
61
+ }
@@ -0,0 +1,39 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ /** primary = main upload; supporting = additional evidence */
5
+ export type LegalComplaintAttachmentKind = 'primary' | 'supporting';
6
+
7
+ @Entity({ name: 'legal_complaint_attachments' })
8
+ export class LegalComplaintAttachment extends BaseModel {
9
+ @Column({ type: 'int', nullable: false })
10
+ request_id: number;
11
+
12
+ @Column({ type: 'int', nullable: false })
13
+ service_id: number;
14
+
15
+ @Column({ type: 'int', nullable: false })
16
+ sub_service_id: number;
17
+
18
+ @Column({ type: 'varchar', length: 32, nullable: false, default: 'primary' })
19
+ attachment_kind: string;
20
+
21
+ @Column({ type: 'varchar', length: 255, nullable: false })
22
+ file_name: string;
23
+
24
+ @Column({ type: 'varchar', length: 500, nullable: false })
25
+ file_url: string;
26
+
27
+ @Column({ type: 'varchar', length: 50, nullable: false })
28
+ file_type: string;
29
+
30
+ @Column({ type: 'int', nullable: false })
31
+ file_size: number;
32
+
33
+ @Column({ type: 'int', nullable: false })
34
+ created_by: number;
35
+
36
+ constructor() {
37
+ super();
38
+ }
39
+ }
@@ -0,0 +1,43 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum LegalComplaintMessageType {
5
+ text = 'text',
6
+ }
7
+
8
+ @Entity({ name: 'legal_complaint_chat' })
9
+ export class LegalComplaintChat extends BaseModel {
10
+ @Column({ type: 'int', nullable: false })
11
+ request_id: number;
12
+
13
+ @Column({ type: 'int', nullable: false })
14
+ service_id: number;
15
+
16
+ @Column({ type: 'int', nullable: false })
17
+ sub_service_id: number;
18
+
19
+ @Column({ type: 'int', nullable: false })
20
+ user_id: number;
21
+
22
+ @Column({ type: 'int', nullable: true })
23
+ approver_role_id: number;
24
+
25
+ @Column({ type: 'text', nullable: false })
26
+ message: string;
27
+
28
+ @Column({ type: 'varchar', length: 50, nullable: false, default: 'text' })
29
+ message_type: string;
30
+
31
+ @Column({ type: 'varchar', length: 50, nullable: true })
32
+ status: string;
33
+
34
+ @Column({ type: 'boolean', nullable: false, default: false })
35
+ is_internal: boolean;
36
+
37
+ @Column({ type: 'int', nullable: false })
38
+ created_by: number;
39
+
40
+ constructor() {
41
+ super();
42
+ }
43
+ }
@@ -0,0 +1,70 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum LegalComplaintRequestStatus {
5
+ Pending = 'Pending',
6
+ Approved = 'Approved',
7
+ Rejected = 'Rejected',
8
+ RFC = 'RFC',
9
+ }
10
+
11
+ @Entity({ name: 'legal_complaint_requests' })
12
+ export class LegalComplaintRequest extends BaseModel {
13
+ @Column({ type: 'date', nullable: false })
14
+ complaint_date: Date;
15
+
16
+ @Column({ type: 'varchar', length: 500, nullable: false })
17
+ title: string;
18
+
19
+ @Column({ type: 'text', nullable: false })
20
+ description: string;
21
+
22
+ /** Times, dates, locations, individuals, events, etc. */
23
+ @Column({ type: 'text', nullable: false })
24
+ complaint_details: string;
25
+
26
+ /** Name / Position / Employee ID / Directorate / Department / Section (structured text or JSON) */
27
+ @Column({ type: 'text', nullable: false })
28
+ complainant_details: string;
29
+
30
+ /** Subject of complaint: Name / Position / Salary Grade / Directorate / Department / Section */
31
+ @Column({ type: 'text', nullable: false })
32
+ complained_employee_details: string;
33
+
34
+ @Column({ type: 'int', nullable: true })
35
+ req_user_department_id: number | null;
36
+
37
+ @Column({ type: 'int', nullable: true })
38
+ req_user_section_id: number | null;
39
+
40
+ @Column({ type: 'varchar', length: 20, nullable: false, default: 'Pending' })
41
+ status: string;
42
+
43
+ @Column({ type: 'int', nullable: true })
44
+ user_id: number;
45
+
46
+ @Column({ type: 'varchar', length: 255, nullable: true })
47
+ workflow_execution_id: string;
48
+
49
+ @Column({ type: 'int', nullable: false })
50
+ created_by: number;
51
+
52
+ @Column({ type: 'int', nullable: true })
53
+ approved_by: number;
54
+
55
+ @Column({ type: 'date', nullable: true })
56
+ approved_at: Date;
57
+
58
+ @Column({ type: 'text', nullable: true })
59
+ approver_comment: string;
60
+
61
+ @Column({ type: 'int', nullable: false })
62
+ service_id: number;
63
+
64
+ @Column({ type: 'int', nullable: false })
65
+ sub_service_id: number;
66
+
67
+ constructor() {
68
+ super();
69
+ }
70
+ }
@@ -0,0 +1,59 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum LegalComplaintWorkFlowStatus {
5
+ Pending = 'Pending',
6
+ InProgress = 'In Progress',
7
+ Approved = 'Approved',
8
+ Rejected = 'Rejected',
9
+ RFC = 'RFC',
10
+ }
11
+
12
+ @Entity({ name: 'legal_complaint_workflow' })
13
+ export class LegalComplaintWorkflow extends BaseModel {
14
+ @Column({ type: 'int', nullable: false })
15
+ request_id: number;
16
+
17
+ @Column({ type: 'int', nullable: true })
18
+ service_id: number;
19
+
20
+ @Column({ type: 'int', nullable: true })
21
+ sub_service_id: number;
22
+
23
+ @Column({ type: 'int', nullable: true })
24
+ workflow_definition_id: number;
25
+
26
+ @Column({ type: 'int', nullable: true })
27
+ current_level: number;
28
+
29
+ @Column({ type: 'varchar', length: 500, nullable: true })
30
+ content: string;
31
+
32
+ @Column({ type: 'varchar', length: 50, nullable: false })
33
+ status: string;
34
+
35
+ @Column({ type: 'int', nullable: true })
36
+ step_order: number;
37
+
38
+ @Column({ type: 'int', nullable: true })
39
+ user_id: number;
40
+
41
+ @Column({ type: 'int', nullable: true })
42
+ role_id: number;
43
+
44
+ @Column({ type: 'int', nullable: true })
45
+ department_id: number;
46
+
47
+ @Column({ type: 'int', nullable: true })
48
+ section_id: number;
49
+
50
+ @Column({ type: 'text', nullable: true })
51
+ workflow_data: string;
52
+
53
+ @Column({ type: 'int', nullable: false })
54
+ created_by: number;
55
+
56
+ constructor() {
57
+ super();
58
+ }
59
+ }
@@ -6,6 +6,8 @@ export enum LegalConsultationApprovalStatus {
6
6
  IN_PROGRESS = 'In Progress',
7
7
  APPROVED = 'Approved',
8
8
  REJECTED = 'Rejected',
9
+ /** Current step completed by assigning the next approver (user/dept/section/role). */
10
+ REASSIGNED = 'Reassigned',
9
11
  }
10
12
 
11
13
  @Entity({ name: 'legal_consultation_approvals' })
@@ -10,10 +10,6 @@ export enum LegalConsultationRequestStatus {
10
10
 
11
11
  @Entity({ name: 'legal_consultation_requests' })
12
12
  export class LegalConsultationRequest extends BaseModel {
13
- /** Business reference (populated by create worker / workflow) */
14
- @Column({ type: 'varchar', length: 20, nullable: true })
15
- request_id: string | null;
16
-
17
13
  @Column({ type: 'date', nullable: false })
18
14
  request_date: Date;
19
15