@platform-modules/civil-aviation-authority 2.0.85 → 2.0.86

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.
Files changed (46) hide show
  1. package/.env +10 -4
  2. package/dist/data-source.js +21 -1
  3. package/dist/index.d.ts +10 -0
  4. package/dist/index.js +10 -0
  5. package/dist/models/AccessCardApprovalModel.d.ts +22 -0
  6. package/dist/models/AccessCardApprovalModel.js +96 -0
  7. package/dist/models/AccessCardAttachmentModel.d.ts +12 -0
  8. package/dist/models/AccessCardAttachmentModel.js +64 -0
  9. package/dist/models/AccessCardChatModel.d.ts +17 -0
  10. package/dist/models/AccessCardChatModel.js +67 -0
  11. package/dist/models/AccessCardRequestModel.d.ts +43 -0
  12. package/dist/models/AccessCardRequestModel.js +148 -0
  13. package/dist/models/AccessCardWorkflowModel.d.ts +14 -0
  14. package/dist/models/AccessCardWorkflowModel.js +60 -0
  15. package/dist/models/HotelApprovalModel.d.ts +22 -0
  16. package/dist/models/HotelApprovalModel.js +91 -0
  17. package/dist/models/HotelAttachedModel.d.ts +14 -0
  18. package/dist/models/HotelAttachedModel.js +74 -0
  19. package/dist/models/HotelChatModel.d.ts +17 -0
  20. package/dist/models/HotelChatModel.js +67 -0
  21. package/dist/models/HotelWorkFlowModel.d.ts +14 -0
  22. package/dist/models/HotelWorkFlowModel.js +56 -0
  23. package/dist/models/HotelreservationModel.d.ts +45 -0
  24. package/dist/models/HotelreservationModel.js +177 -0
  25. package/dist/models/ItApprovalsModel.d.ts +2 -1
  26. package/dist/models/ItApprovalsModel.js +7 -2
  27. package/dist/models/ServiceTypeModel.d.ts +7 -1
  28. package/dist/models/ServiceTypeModel.js +24 -2
  29. package/dist/models/WorkflowHierarchy.d.ts +1 -6
  30. package/dist/models/WorkflowHierarchy.js +2 -27
  31. package/package.json +1 -1
  32. package/src/data-source.ts +21 -1
  33. package/src/index.ts +10 -0
  34. package/src/models/AccessCardApprovalModel.ts +83 -0
  35. package/src/models/AccessCardAttachmentModel.ts +51 -0
  36. package/src/models/AccessCardChatModel.ts +54 -0
  37. package/src/models/AccessCardRequestModel.ts +135 -0
  38. package/src/models/AccessCardWorkflowModel.ts +47 -0
  39. package/src/models/HotelApprovalModel.ts +79 -0
  40. package/src/models/HotelAttachedModel.ts +64 -0
  41. package/src/models/HotelChatModel.ts +55 -0
  42. package/src/models/HotelWorkFlowModel.ts +42 -0
  43. package/src/models/HotelreservationModel.ts +166 -0
  44. package/src/models/ItApprovalsModel.ts +6 -1
  45. package/src/models/ServiceTypeModel.ts +21 -1
  46. package/src/models/WorkflowHierarchy.ts +1 -26
@@ -0,0 +1,64 @@
1
+ import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+
5
+ @Entity({ name: 'hotel_request_attachments' })
6
+ export class HotelRequestAttachment extends BaseModel {
7
+
8
+ @Column({ type: 'integer', nullable: false })
9
+ request_id: number;
10
+
11
+ @Column({ type: 'integer', nullable: true })
12
+ service_id: number | null;
13
+
14
+ @Column({ type: 'integer', nullable: true })
15
+ sub_service_id: number | null;
16
+
17
+ @Column({ type: 'varchar', length: 500, nullable: false })
18
+ file_url: string;
19
+
20
+ @Column({ type: 'varchar', length: 255, nullable: true })
21
+ file_name: string;
22
+
23
+ @Column({ type: 'varchar', length: 100, nullable: true })
24
+ file_type: string;
25
+
26
+ @Column({ type: 'bigint', nullable: true })
27
+ file_size: number | null;
28
+
29
+ @Column({ type: 'integer', nullable: true })
30
+ chat_id: number | null;
31
+
32
+ @Column({ type: "integer", nullable: false })
33
+ uploaded_by: number;
34
+
35
+ @Column({ type: "text", nullable: true })
36
+ description: string;
37
+
38
+
39
+ constructor(
40
+ request_id: number,
41
+ uploaded_by: number,
42
+ file_url: string,
43
+ file_name?: string,
44
+ file_type?: string,
45
+ file_size?: number,
46
+ service_id?: number,
47
+ sub_service_id?: number,
48
+ chat_id?: number,
49
+ description?: string
50
+ ) {
51
+ super();
52
+ this.request_id = request_id;
53
+ this.service_id = service_id || null;
54
+ this.sub_service_id = sub_service_id || null;
55
+ this.file_url = file_url;
56
+ this.file_name = file_name || '';
57
+ this.file_type = file_type || '';
58
+ this.file_size = file_size || null;
59
+ this.chat_id = chat_id || null;
60
+ this.uploaded_by = uploaded_by;
61
+ this.description = description || '';
62
+ }
63
+ }
64
+
@@ -0,0 +1,55 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum HotelMessageTypes {
5
+ TEXT = "text",
6
+ IMAGE = "image",
7
+ VIDEO = "video",
8
+ FILE = "file",
9
+ LINK = "link"
10
+ }
11
+
12
+ @Entity({ name: 'Hotel_request_chat' })
13
+ export class HotelRequestChat extends BaseModel {
14
+
15
+ @Column({ type: 'integer', nullable: false })
16
+ request_id: number;
17
+
18
+ @Column({ type: 'integer', nullable: true })
19
+ service_id: number | null;
20
+
21
+ @Column({ type: 'integer', nullable: true })
22
+ sub_service_id: number | null;
23
+
24
+ @Column({ type: 'integer', nullable: false })
25
+ user_id: number;
26
+
27
+ @Column({ type: 'text', nullable: false })
28
+ message: string;
29
+
30
+ @Column({
31
+ type: 'enum',
32
+ enum: HotelMessageTypes,
33
+ default: HotelMessageTypes.TEXT,
34
+ nullable: false
35
+ })
36
+ messageType: HotelMessageTypes;
37
+
38
+ constructor(
39
+ request_id: number,
40
+ user_id: number,
41
+ message: string,
42
+ service_id?: number,
43
+ sub_service_id?: number,
44
+ messageType?: HotelMessageTypes
45
+ ) {
46
+ super();
47
+ this.request_id = request_id;
48
+ this.service_id = service_id || null;
49
+ this.sub_service_id = sub_service_id || null;
50
+ this.user_id = user_id;
51
+ this.message = message;
52
+ this.messageType = messageType || HotelMessageTypes.TEXT;
53
+ }
54
+ }
55
+
@@ -0,0 +1,42 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum HotelWorkFlowStatus {
5
+ COMPLETED = "Completed",
6
+ NOT_YET_STARTED = "Not Yet Started",
7
+ PENDING = "Pending"
8
+ }
9
+
10
+ //This model is used to store the logistics workflow status and activity logs
11
+ @Entity({ name: 'hotel_workflows' })
12
+ export class HotelWorkFlow extends BaseModel {
13
+ @Column({ type: 'integer', nullable: false })
14
+ request_id: number;
15
+
16
+ @Column({ type: 'integer', nullable: true })
17
+ service_id: number | null;
18
+
19
+ @Column({ type: 'integer', nullable: true })
20
+ sub_service_id: number | null;
21
+
22
+ @Column({ type: 'varchar', length: 500, nullable: false })
23
+ content: string;
24
+
25
+ @Column({ type: 'enum', enum: HotelWorkFlowStatus, default: HotelWorkFlowStatus.NOT_YET_STARTED, nullable: false })
26
+ status: HotelWorkFlowStatus;
27
+
28
+ constructor(
29
+ request_id: number,
30
+ content: string,
31
+ status: HotelWorkFlowStatus,
32
+ service_id?: number,
33
+ sub_service_id?: number
34
+ ) {
35
+ super();
36
+ this.request_id = request_id;
37
+ this.service_id = service_id || null;
38
+ this.sub_service_id = sub_service_id || null;
39
+ this.content = content;
40
+ this.status = status;
41
+ }
42
+ }
@@ -0,0 +1,166 @@
1
+ import { Entity, Column } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum MealType {
5
+ BREAKFAST = "Breakfast",
6
+ LUNCH = "Lunch",
7
+ DINNER = "Dinner",
8
+ }
9
+
10
+ export enum ServiceTypes {
11
+ LAUNDRY = "Laundry",
12
+ TELEPHONE = "Telephone Service",
13
+ }
14
+
15
+ export enum HotelReservationStatus {
16
+ PENDING = "Pending",
17
+ APPROVED = "Approved",
18
+ REJECTED = "Rejected",
19
+ IN_PROGRESS = "In Progress"
20
+ }
21
+
22
+ @Entity({ name:'hotelreservations'})
23
+ export class HotelReservation extends BaseModel {
24
+ // Workflow fields (similar to IT Help Desk)
25
+ @Column({ type: 'int', nullable: true })
26
+ req_user_department_id: number | null;
27
+
28
+ @Column({ type: 'int', nullable: true })
29
+ req_user_section_id: number | null;
30
+
31
+ @Column({ type: 'int', nullable: true })
32
+ service_id: number | null;
33
+
34
+ @Column({ type: 'int', nullable: true })
35
+ sub_service_id: number | null;
36
+
37
+ @Column({ type: 'varchar', length: 20, nullable: true })
38
+ service_type: string | null; // 'internal' or 'external'
39
+
40
+ @Column({ type: 'varchar', nullable: true })
41
+ workflow_execution_id: string | null;
42
+
43
+ @Column({
44
+ type: "enum",
45
+ enum: HotelReservationStatus,
46
+ default: HotelReservationStatus.PENDING,
47
+ nullable: false,
48
+ })
49
+ status: HotelReservationStatus;
50
+
51
+ @Column({ nullable: false })
52
+ user_id: number;
53
+
54
+ // Hotel reservation specific fields
55
+ @Column({ type: 'varchar', length: 50 })
56
+ type_of_accommodation: string;
57
+
58
+ @Column({ type: 'decimal', precision: 10, scale: 2, nullable: false })
59
+ price: number;
60
+
61
+ @Column({ type: 'enum', enum: MealType, nullable: false, })
62
+ meal: MealType;
63
+
64
+ @Column({ type: 'enum', enum: ServiceTypes, nullable: false, })
65
+ service: ServiceTypes;
66
+
67
+ @Column({ type: 'timestamptz', nullable: false })
68
+ date_of_request: Date;
69
+
70
+ @Column({ type: 'varchar', length: 100, nullable: false })
71
+ hotel_name: string;
72
+
73
+ @Column({ type: 'date', nullable: false })
74
+ check_in_date: Date;
75
+
76
+ @Column({ type: 'time', nullable: false })
77
+ check_in_time: string;
78
+
79
+ @Column({ type: 'date', nullable: false })
80
+ check_out_date: Date;
81
+
82
+ @Column({ type: 'date', nullable: true })
83
+ booking_date: Date | null;
84
+
85
+ @Column({ type: 'time', nullable: false })
86
+ check_out_time: string;
87
+
88
+ @Column({ type: 'int', nullable: false })
89
+ number_of_guests: number;
90
+
91
+ @Column({ type: 'text', nullable: true })
92
+ description: string;
93
+
94
+ @Column({ type: 'text', nullable: true })
95
+ attachment_url: string | null;
96
+
97
+ @Column({ type: 'varchar', length: 100, nullable: false })
98
+ requested_by: string;
99
+
100
+ @Column({ type: 'varchar', length: 100, nullable: true })
101
+ visitor_name: string | null;
102
+
103
+ @Column({ type: 'boolean', default: false })
104
+ hr_approval: boolean;
105
+
106
+ @Column({ type: 'boolean', default: false })
107
+ pr_approval: boolean;
108
+
109
+
110
+ constructor(
111
+ type_of_accommodation: string,
112
+ price: number,
113
+ meal: MealType,
114
+ service: ServiceTypes,
115
+ date_of_request: Date,
116
+ hotel_name: string,
117
+ check_in_date: Date,
118
+ booking_date: Date | null,
119
+ check_in_time: string,
120
+ check_out_date: Date,
121
+ check_out_time: string,
122
+ number_of_guests: number,
123
+ description: string,
124
+ requested_by: string,
125
+ visitor_name: string,
126
+ user_id: number,
127
+ status: HotelReservationStatus = HotelReservationStatus.PENDING,
128
+ hr_approval: boolean = false,
129
+ pr_approval: boolean = false,
130
+ service_id?: number | null,
131
+ sub_service_id?: number | null,
132
+ service_type?: string | null,
133
+ workflow_execution_id?: string | null,
134
+ req_user_department_id?: number | null,
135
+ req_user_section_id?: number | null,
136
+ attachment_url?: string | null
137
+ ) {
138
+ super();
139
+ this.type_of_accommodation = type_of_accommodation;
140
+ this.price = price;
141
+ this.meal = meal;
142
+ this.service = service;
143
+ this.date_of_request = date_of_request;
144
+ this.hotel_name = hotel_name;
145
+ this.check_in_date = check_in_date;
146
+ this.check_in_time = check_in_time;
147
+ this.check_out_date = check_out_date;
148
+ this.check_out_time = check_out_time;
149
+ this.number_of_guests = number_of_guests;
150
+ this.description = description;
151
+ this.requested_by = requested_by;
152
+ this.visitor_name = visitor_name;
153
+ this.user_id = user_id;
154
+ this.status = status;
155
+ this.hr_approval = hr_approval;
156
+ this.pr_approval = pr_approval;
157
+ this.service_id = service_id ?? null;
158
+ this.sub_service_id = sub_service_id ?? null;
159
+ this.service_type = service_type ?? null;
160
+ this.workflow_execution_id = workflow_execution_id ?? null;
161
+ this.req_user_department_id = req_user_department_id ?? null;
162
+ this.req_user_section_id = req_user_section_id ?? null;
163
+ this.attachment_url = attachment_url ?? null;
164
+ this.booking_date = booking_date ?? null;
165
+ }
166
+ }
@@ -25,6 +25,9 @@ export class ItApprovalDetails extends BaseModel {
25
25
  @Column({ type: 'integer', nullable: true })
26
26
  approver_user_id: number | null;
27
27
 
28
+ @Column({ type: 'integer', nullable: true })
29
+ delegation_user_id: number | null;
30
+
28
31
  @Column({ type: 'integer', nullable: false })
29
32
  approver_role_id: number | null;
30
33
 
@@ -54,7 +57,8 @@ export class ItApprovalDetails extends BaseModel {
54
57
  section_id?: number | null,
55
58
  approved_by?: number | null,
56
59
  service_id?: number | null,
57
- sub_service_id?: number | null
60
+ sub_service_id?: number | null,
61
+ delegation_user_id?: number | null
58
62
  ) {
59
63
  super();
60
64
  this.request_id = request_id;
@@ -68,5 +72,6 @@ export class ItApprovalDetails extends BaseModel {
68
72
  this.approved_by = approved_by || null;
69
73
  this.service_id = service_id ?? null;
70
74
  this.sub_service_id = sub_service_id ?? null;
75
+ this.delegation_user_id = delegation_user_id || null;
71
76
  }
72
77
  }
@@ -2,6 +2,8 @@ import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
2
2
  import { BaseModel } from './BaseModel';
3
3
  import { CAAServices } from './CAAServices';
4
4
  import { CAASubServices } from './CAASubServices';
5
+ import { Departments } from './DepartmentsModel';
6
+ import { Sections } from './SectionModel';
5
7
 
6
8
  @Entity({ name: 'service_types' })
7
9
  export class ServiceType extends BaseModel {
@@ -26,6 +28,20 @@ export class ServiceType extends BaseModel {
26
28
  @JoinColumn({ name: 'sub_service_id' })
27
29
  sub_service: CAASubServices;
28
30
 
31
+ @Column({ type: 'bigint', nullable: true })
32
+ department_id: number | null;
33
+
34
+ @ManyToOne(() => Departments)
35
+ @JoinColumn({ name: 'department_id' })
36
+ department: Departments;
37
+
38
+ @Column({ type: 'bigint', nullable: true })
39
+ section_id: number | null;
40
+
41
+ @ManyToOne(() => Sections)
42
+ @JoinColumn({ name: 'section_id' })
43
+ section: Sections;
44
+
29
45
  @Column({ nullable: true })
30
46
  description: string;
31
47
 
@@ -38,7 +54,9 @@ export class ServiceType extends BaseModel {
38
54
  service_id: number,
39
55
  sub_service_id: number,
40
56
  description?: string,
41
- is_active?: boolean
57
+ is_active?: boolean,
58
+ department_id?: number | null,
59
+ section_id?: number | null
42
60
  ) {
43
61
  super();
44
62
  this.name = name;
@@ -47,6 +65,8 @@ export class ServiceType extends BaseModel {
47
65
  this.sub_service_id = sub_service_id;
48
66
  this.description = description || '';
49
67
  this.is_active = is_active !== undefined ? is_active : true;
68
+ this.department_id = department_id || null;
69
+ this.section_id = section_id || null;
50
70
  }
51
71
  }
52
72
 
@@ -39,21 +39,6 @@ export class WorkflowHierarchy extends BaseModel {
39
39
  @Column({ type: 'varchar',length: 255, nullable:true })
40
40
  task_type: string | null;
41
41
 
42
- @Column({ type: 'varchar', length: 50, nullable: true })
43
- decision_path: string | null; // 'true', 'false', or null for non-decision tasks (legacy support)
44
-
45
- @Column({ type: 'integer', nullable: true })
46
- parent_decision_step_order: number | null; // References step_order of the DECISION task (legacy support)
47
-
48
- @Column({ type: 'varchar', length: 255, nullable: true })
49
- parent_task: string | null; // Name of the previous task in the flow
50
-
51
- @Column({ type: 'text', nullable: true })
52
- condition_expression: string | null; // Logical condition for when this task should execute (e.g., "createdByRole == true")
53
-
54
- @Column({ type: 'boolean', default: false, nullable: false })
55
- is_decision_task: boolean; // Whether this task represents a decision node
56
-
57
42
  @ManyToOne(() => WorkflowDefinitions, { onDelete: 'CASCADE' })
58
43
  @JoinColumn({ name: 'workflow_definition_id' })
59
44
  workflow_definition: WorkflowDefinitions;
@@ -69,12 +54,7 @@ export class WorkflowHierarchy extends BaseModel {
69
54
  taskname?: string,
70
55
  status?: string,
71
56
  task?: any,
72
- task_type?: string,
73
- decision_path?: string | null,
74
- parent_decision_step_order?: number | null,
75
- parent_task?: string | null,
76
- condition_expression?: string | null,
77
- is_decision_task?: boolean
57
+ task_type?:string
78
58
  ) {
79
59
  super();
80
60
  this.workflow_definition_id = workflow_definition_id;
@@ -88,10 +68,5 @@ export class WorkflowHierarchy extends BaseModel {
88
68
  this.status = status || null;
89
69
  this.task = task || null;
90
70
  this.task_type = task_type || null;
91
- this.decision_path = decision_path || null;
92
- this.parent_decision_step_order = parent_decision_step_order || null;
93
- this.parent_task = parent_task || null;
94
- this.condition_expression = condition_expression || null;
95
- this.is_decision_task = is_decision_task !== undefined ? is_decision_task : false;
96
71
  }
97
72
  }