@platform-modules/civil-aviation-authority 2.3.140 → 2.3.145

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.
@@ -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