@platform-modules/civil-aviation-authority 2.0.3 → 2.0.5

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.
@@ -1,74 +1,84 @@
1
- // src/data-source.ts
2
- import 'reflect-metadata';
3
- import { DataSource } from 'typeorm';
4
- import 'dotenv/config';
5
- import { User } from './models/user'; // import all entities here
6
- import { userSessions } from './models/user-sessions';
7
- import { Role } from './models/role';
8
- import { ITHelpDeskRequests } from './models/ITHelpDeskModel';
9
- import { ITServicesTypesSalalah } from './models/ITServicesTypesSalalahModel';
10
- import { ITServicesTypesMuscat } from './models/ITServicesTypesMuscatModel';
11
- import { ServiceType } from './models/ServiceTypeModel';
12
- import { CAAServices } from './models/CAAServices';
13
- import { CAASubServices } from './models/CAASubServices';
14
- import { ITApprovalSettings } from './models/ITApprovalSettings';
15
- // import { Workflows } from './models/Workflows';
16
- import { ItApprovalDetails } from './models/ItApprovalsModel';
17
- import { ItWorkFlow } from './models/ItWorkflowModel';
18
- import { WorkflowDefinitions } from './models/WorkflowDefinitions';
19
- import { WorkflowTask } from './models/WorkflowTask';
20
- import { Departments } from './models/DepartmentsModel';
21
- import { Sections } from './models/SectionModel';
22
- import { WorkflowHierarchy } from './models/WorkflowHierarchy';
23
- import { WorkflowTaskNames } from './models/WorkflowTaskNames';
24
- import { Directorate } from './models/DirectorateModel';
25
- import { Position } from './models/PositionModel';
26
- import { ServiceBookmarks } from './models/serviceBookmarksModel';
27
- import { ContactInfo } from './models/contactInfoModel';
28
- import { UserRole } from './models/userRolesModel';
29
- import { RoleRights } from './models/roleRightsModel';
30
- import { Notification } from './models/NotificationModel';
31
- import { ITRequestChat } from './models/ITRequestChatModel';
32
- import { ITRequestAttachment } from './models/ITRequestAttachmentModel';
33
-
34
-
35
-
36
- export const AppDataSource = new DataSource({
37
- type: 'postgres',
38
- host: process.env.DB_HOST || 'localhost',
39
- port: +(process.env.DB_PORT || 5432),
40
- username: process.env.DB_USER || 'postgres',
41
- password: process.env.DB_PASS || 'postgres',
42
- database: process.env.DB_NAME || 'common_models',
43
- synchronize: true, // auto-create tables (disable in prod)
44
- logging: false,
45
- entities: [
46
- User,userSessions,
47
- Role,
48
- ITHelpDeskRequests,
49
- ITServicesTypesSalalah,
50
- ITServicesTypesMuscat,
51
- ServiceType,
52
- CAAServices,
53
- CAASubServices,
54
- ITApprovalSettings,
55
- // Workflows,
56
- ItApprovalDetails,
57
- ItWorkFlow,
58
- WorkflowDefinitions,
59
- WorkflowTask,
60
- Departments,
61
- Sections,
62
- WorkflowHierarchy,
63
- WorkflowTaskNames,
64
- Directorate,
65
- Position,
66
- ServiceBookmarks,
67
- ContactInfo,
68
- UserRole,
69
- RoleRights,
70
- Notification,
71
- ITRequestChat,
72
- ITRequestAttachment
73
- ],
74
- });
1
+ // src/data-source.ts
2
+ import 'reflect-metadata';
3
+ import { DataSource } from 'typeorm';
4
+ import 'dotenv/config';
5
+ import { User } from './models/user'; // import all entities here
6
+ import { userSessions } from './models/user-sessions';
7
+ import { Role } from './models/role';
8
+ import { ITHelpDeskRequests } from './models/ITHelpDeskModel';
9
+ import { ITServicesTypesSalalah } from './models/ITServicesTypesSalalahModel';
10
+ import { ITServicesTypesMuscat } from './models/ITServicesTypesMuscatModel';
11
+ import { ServiceType } from './models/ServiceTypeModel';
12
+ import { CAAServices } from './models/CAAServices';
13
+ import { CAASubServices } from './models/CAASubServices';
14
+ import { ITApprovalSettings } from './models/ITApprovalSettings';
15
+ // import { Workflows } from './models/Workflows';
16
+ import { ItApprovalDetails } from './models/ItApprovalsModel';
17
+ import { ItWorkFlow } from './models/ItWorkflowModel';
18
+ import { WorkflowDefinitions } from './models/WorkflowDefinitions';
19
+ import { WorkflowTask } from './models/WorkflowTask';
20
+ import { Departments } from './models/DepartmentsModel';
21
+ import { Sections } from './models/SectionModel';
22
+ import { WorkflowHierarchy } from './models/WorkflowHierarchy';
23
+ import { WorkflowTaskNames } from './models/WorkflowTaskNames';
24
+ import { Directorate } from './models/DirectorateModel';
25
+ import { Position } from './models/PositionModel';
26
+ import { ServiceBookmarks } from './models/serviceBookmarksModel';
27
+ import { ContactInfo } from './models/contactInfoModel';
28
+ import { UserRole } from './models/userRolesModel';
29
+ import { RoleRights } from './models/roleRightsModel';
30
+ import { Notification } from './models/NotificationModel';
31
+ import { ITRequestChat } from './models/ITRequestChatModel';
32
+ import { ITRequestAttachment } from './models/ITRequestAttachmentModel';
33
+ import { LogisticsRequests } from './models/LogisticsModel';
34
+ import { LogisticsApprovalDetails } from './models/LogisticsApprovalModel';
35
+ import { LogisticsRequestChat } from './models/LogisticsChatModel';
36
+ import { LogisticsRequestAttachment } from './models/LogisticsAttachmentModel';
37
+ import { LogisticsWorkFlow } from './models/LogisticsWorkflowModel';
38
+
39
+
40
+
41
+ export const AppDataSource = new DataSource({
42
+ type: 'postgres',
43
+ host: process.env.DB_HOST || 'localhost',
44
+ port: +(process.env.DB_PORT || 5432),
45
+ username: process.env.DB_USER || 'postgres',
46
+ password: process.env.DB_PASS || 'postgres',
47
+ database: process.env.DB_NAME || 'common_models',
48
+ synchronize: true, // auto-create tables (disable in prod)
49
+ logging: false,
50
+ entities: [
51
+ User,userSessions,
52
+ Role,
53
+ ITHelpDeskRequests,
54
+ ITServicesTypesSalalah,
55
+ ITServicesTypesMuscat,
56
+ ServiceType,
57
+ CAAServices,
58
+ CAASubServices,
59
+ ITApprovalSettings,
60
+ // Workflows,
61
+ ItApprovalDetails,
62
+ ItWorkFlow,
63
+ WorkflowDefinitions,
64
+ WorkflowTask,
65
+ Departments,
66
+ Sections,
67
+ WorkflowHierarchy,
68
+ WorkflowTaskNames,
69
+ Directorate,
70
+ Position,
71
+ ServiceBookmarks,
72
+ ContactInfo,
73
+ UserRole,
74
+ RoleRights,
75
+ Notification,
76
+ ITRequestChat,
77
+ ITRequestAttachment,
78
+ LogisticsRequests,
79
+ LogisticsApprovalDetails,
80
+ LogisticsRequestChat,
81
+ LogisticsRequestAttachment,
82
+ LogisticsWorkFlow
83
+ ],
84
+ });
package/src/index.ts CHANGED
@@ -1,28 +1,33 @@
1
- export * from './models/user';
2
- export * from './models/role';
3
- export * from './models/user-sessions';
4
- export * from './models/ITHelpDeskModel';
5
- export * from './models/ITServicesTypesSalalahModel';
6
- export * from './models/ITServicesTypesMuscatModel';
7
- export * from './models/ServiceTypeModel';
8
- export * from './models/CAAServices';
9
- export * from './models/CAASubServices';
10
- export * from './models/ITApprovalSettings';
11
- // export * from './models/Workflows';
12
- export * from './models/ItApprovalsModel';
13
- export * from './models/ItWorkflowModel';
14
- export * from './models/WorkflowDefinitions';
15
- export * from './models/WorkflowTask';
16
- export * from './models/DepartmentsModel';
17
- export * from './models/SectionModel';
18
- export * from './models/WorkflowHierarchy';
19
- export * from './models/WorkflowTaskNames';
20
- export * from './models/DirectorateModel';
21
- export * from './models/PositionModel';
22
- export * from './models/serviceBookmarksModel';
23
- export * from './models/contactInfoModel';
24
- export * from './models/userRolesModel';
25
- export * from './models/roleRightsModel';
26
- export * from './models/NotificationModel';
27
- export * from './models/ITRequestChatModel';
28
- export * from './models/ITRequestAttachmentModel';
1
+ export * from './models/user';
2
+ export * from './models/role';
3
+ export * from './models/user-sessions';
4
+ export * from './models/ITHelpDeskModel';
5
+ export * from './models/ITServicesTypesSalalahModel';
6
+ export * from './models/ITServicesTypesMuscatModel';
7
+ export * from './models/ServiceTypeModel';
8
+ export * from './models/CAAServices';
9
+ export * from './models/CAASubServices';
10
+ export * from './models/ITApprovalSettings';
11
+ // export * from './models/Workflows';
12
+ export * from './models/ItApprovalsModel';
13
+ export * from './models/ItWorkflowModel';
14
+ export * from './models/WorkflowDefinitions';
15
+ export * from './models/WorkflowTask';
16
+ export * from './models/DepartmentsModel';
17
+ export * from './models/SectionModel';
18
+ export * from './models/WorkflowHierarchy';
19
+ export * from './models/WorkflowTaskNames';
20
+ export * from './models/DirectorateModel';
21
+ export * from './models/PositionModel';
22
+ export * from './models/serviceBookmarksModel';
23
+ export * from './models/contactInfoModel';
24
+ export * from './models/userRolesModel';
25
+ export * from './models/roleRightsModel';
26
+ export * from './models/NotificationModel';
27
+ export * from './models/ITRequestChatModel';
28
+ export * from './models/ITRequestAttachmentModel';
29
+ export * from './models/LogisticsModel';
30
+ export * from './models/LogisticsApprovalModel';
31
+ export * from './models/LogisticsChatModel';
32
+ export * from './models/LogisticsAttachmentModel';
33
+ export * from './models/LogisticsWorkflowModel';
@@ -1,47 +1,47 @@
1
- import moment from "moment-timezone";
2
- import {
3
- Column,
4
- CreateDateColumn,
5
- UpdateDateColumn,
6
- BeforeInsert,
7
- PrimaryGeneratedColumn
8
- } from 'typeorm';
9
-
10
- export abstract class Model0 {
11
- jsonIgnore: string[] = ['logicalDelete', 'is_deleted', 'jsonIgnore'];
12
-
13
- @Column({ type: 'integer', nullable: true })
14
- created_by?: number;
15
-
16
- @CreateDateColumn({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" })
17
- created_at?: Date;
18
-
19
- @Column({ type: 'integer', nullable: true })
20
- updated_by?: number;
21
-
22
- @UpdateDateColumn({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" })
23
- updated_at?: Date;
24
-
25
- @BeforeInsert()
26
- insertCreated() {
27
- const currentTime = moment().utc().tz('Asia/Kolkata').toDate();
28
- this.created_at = currentTime;
29
- this.updated_at = currentTime;
30
- }
31
-
32
- @Column({ nullable: true, default: false })
33
- is_deleted?: boolean = false;
34
-
35
- constructor() {
36
- }
37
- }
38
-
39
- export abstract class BaseModel extends Model0 {
40
- @PrimaryGeneratedColumn()
41
- id: number;
42
-
43
- constructor() {
44
- super();
45
- this.id = 0; // This will be set by the database when the entity is saved
46
- }
1
+ import moment from "moment-timezone";
2
+ import {
3
+ Column,
4
+ CreateDateColumn,
5
+ UpdateDateColumn,
6
+ BeforeInsert,
7
+ PrimaryGeneratedColumn
8
+ } from 'typeorm';
9
+
10
+ export abstract class Model0 {
11
+ jsonIgnore: string[] = ['logicalDelete', 'is_deleted', 'jsonIgnore'];
12
+
13
+ @Column({ type: 'integer', nullable: true })
14
+ created_by?: number;
15
+
16
+ @CreateDateColumn({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" })
17
+ created_at?: Date;
18
+
19
+ @Column({ type: 'integer', nullable: true })
20
+ updated_by?: number;
21
+
22
+ @UpdateDateColumn({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" })
23
+ updated_at?: Date;
24
+
25
+ @BeforeInsert()
26
+ insertCreated() {
27
+ const currentTime = moment().utc().tz('Asia/Kolkata').toDate();
28
+ this.created_at = currentTime;
29
+ this.updated_at = currentTime;
30
+ }
31
+
32
+ @Column({ nullable: true, default: false })
33
+ is_deleted?: boolean = false;
34
+
35
+ constructor() {
36
+ }
37
+ }
38
+
39
+ export abstract class BaseModel extends Model0 {
40
+ @PrimaryGeneratedColumn()
41
+ id: number;
42
+
43
+ constructor() {
44
+ super();
45
+ this.id = 0; // This will be set by the database when the entity is saved
46
+ }
47
47
  }
@@ -14,15 +14,20 @@ export class CAAServices extends BaseModel {
14
14
  @Column({ nullable: false })
15
15
  description: string;
16
16
 
17
+ @Column({ nullable: true })
18
+ logo_url: string;
19
+
17
20
 
18
21
  constructor(
19
22
  name: string,
20
23
  description: string,
21
- code?: string
24
+ code?: string,
25
+ logo_url?: string
22
26
  ) {
23
27
  super();
24
28
  this.name = name;
25
29
  this.description = description;
26
30
  this.code = code || '';
31
+ this.logo_url = logo_url || '';
27
32
  }
28
33
  }
@@ -1,115 +1,115 @@
1
-
2
- import { Column, Entity } from "typeorm";
3
- import { BaseModel } from './BaseModel';
4
- export enum ContactFor {
5
- SELF = "Self",
6
- BEHALFOF = "Behalf of"
7
- }
8
- export enum status {
9
- PENDING = "Pending",
10
- ASSIGNED = "Assigned",
11
- IN_PROGRESS = "In Progress",
12
- APPROVED = "Approved",
13
- REJECTED = "Rejected"
14
- }
15
- @Entity({ name: 'it_help_desk_requests' })
16
- export class ITHelpDeskRequests extends BaseModel {
17
-
18
- @Column({ type: 'int', nullable: true })
19
- req_user_department_id: number | null;
20
-
21
- @Column({ type: 'int', nullable: true })
22
- req_user_section_id: number | null;
23
-
24
- @Column({ nullable: true })
25
- service_id: number;
26
-
27
- @Column({ nullable: true })
28
- sub_service_id: number;
29
-
30
- @Column({ type: 'int', nullable: true })
31
- service_type_id: number | null;
32
-
33
- @Column({ nullable: false })
34
- problem: string;
35
-
36
- @Column({
37
- type: "enum",
38
- enum: ContactFor,
39
- default: ContactFor.SELF,
40
- nullable: false,
41
- })
42
- request_for: ContactFor;
43
-
44
- @Column({ nullable: false })
45
- description: string;
46
-
47
- @Column({ nullable: false })
48
- extn_num: string;
49
-
50
- @Column({ nullable: false })
51
- contact_num: string;
52
-
53
- @Column({ type: "date", nullable: false })
54
- request_date: Date;
55
-
56
- @Column({ nullable: true })
57
- attachment_url: string;
58
-
59
- @Column({ nullable: false })
60
- user_id: number;
61
-
62
- @Column({ nullable: true })
63
- reporting_manager: number;
64
-
65
- @Column({ nullable: true })
66
- assigned_to: number;
67
-
68
- @Column({
69
- type: "enum",
70
- enum: status,
71
- default: status.PENDING,
72
- nullable: false,
73
- })
74
- status: status;
75
-
76
- @Column({ type: "varchar", nullable: true })
77
- workflow_execution_id: string | null;
78
-
79
- constructor(
80
- service_id: number,
81
- sub_service_id: number,
82
- problem: string,
83
- request_for: ContactFor,
84
- description: string,
85
- extn_num: string,
86
- contact_num: string,
87
- request_date: Date,
88
- attachment_url: string,
89
- reporting_manager: number,
90
- assigned_to: number,
91
- status: status,
92
- workflow_execution_id?: string,
93
- req_user_department_id?: number | null,
94
- req_user_section_id?: number | null,
95
- service_type_id?: number | null
96
- ) {
97
- super();
98
- this.service_id = service_id;
99
- this.sub_service_id = sub_service_id;
100
- this.problem = problem;
101
- this.request_for = request_for;
102
- this.description = description;
103
- this.extn_num = extn_num;
104
- this.contact_num = contact_num;
105
- this.request_date = request_date;
106
- this.attachment_url = attachment_url;
107
- this.reporting_manager = reporting_manager;
108
- this.assigned_to = assigned_to;
109
- this.status = status;
110
- this.workflow_execution_id = workflow_execution_id || null;
111
- this.req_user_department_id = req_user_department_id || null;
112
- this.req_user_section_id = req_user_section_id || null;
113
- this.service_type_id = service_type_id || null;
114
- }
1
+
2
+ import { Column, Entity } from "typeorm";
3
+ import { BaseModel } from './BaseModel';
4
+ export enum ContactFor {
5
+ SELF = "Self",
6
+ BEHALFOF = "Behalf of"
7
+ }
8
+ export enum status {
9
+ PENDING = "Pending",
10
+ ASSIGNED = "Assigned",
11
+ IN_PROGRESS = "In Progress",
12
+ APPROVED = "Approved",
13
+ REJECTED = "Rejected"
14
+ }
15
+ @Entity({ name: 'it_help_desk_requests' })
16
+ export class ITHelpDeskRequests extends BaseModel {
17
+
18
+ @Column({ type: 'int', nullable: true })
19
+ req_user_department_id: number | null;
20
+
21
+ @Column({ type: 'int', nullable: true })
22
+ req_user_section_id: number | null;
23
+
24
+ @Column({ nullable: true })
25
+ service_id: number;
26
+
27
+ @Column({ nullable: true })
28
+ sub_service_id: number;
29
+
30
+ @Column({ type: 'int', nullable: true })
31
+ service_type_id: number | null;
32
+
33
+ @Column({ nullable: false })
34
+ problem: string;
35
+
36
+ @Column({
37
+ type: "enum",
38
+ enum: ContactFor,
39
+ default: ContactFor.SELF,
40
+ nullable: false,
41
+ })
42
+ request_for: ContactFor;
43
+
44
+ @Column({ nullable: false })
45
+ description: string;
46
+
47
+ @Column({ nullable: false })
48
+ extn_num: string;
49
+
50
+ @Column({ nullable: false })
51
+ contact_num: string;
52
+
53
+ @Column({ type: "date", nullable: false })
54
+ request_date: Date;
55
+
56
+ @Column({ nullable: true })
57
+ attachment_url: string;
58
+
59
+ @Column({ nullable: false })
60
+ user_id: number;
61
+
62
+ @Column({ nullable: true })
63
+ reporting_manager: number;
64
+
65
+ @Column({ nullable: true })
66
+ assigned_to: number;
67
+
68
+ @Column({
69
+ type: "enum",
70
+ enum: status,
71
+ default: status.PENDING,
72
+ nullable: false,
73
+ })
74
+ status: status;
75
+
76
+ @Column({ type: "varchar", nullable: true })
77
+ workflow_execution_id: string | null;
78
+
79
+ constructor(
80
+ service_id: number,
81
+ sub_service_id: number,
82
+ problem: string,
83
+ request_for: ContactFor,
84
+ description: string,
85
+ extn_num: string,
86
+ contact_num: string,
87
+ request_date: Date,
88
+ attachment_url: string,
89
+ reporting_manager: number,
90
+ assigned_to: number,
91
+ status: status,
92
+ workflow_execution_id?: string,
93
+ req_user_department_id?: number | null,
94
+ req_user_section_id?: number | null,
95
+ service_type_id?: number | null
96
+ ) {
97
+ super();
98
+ this.service_id = service_id;
99
+ this.sub_service_id = sub_service_id;
100
+ this.problem = problem;
101
+ this.request_for = request_for;
102
+ this.description = description;
103
+ this.extn_num = extn_num;
104
+ this.contact_num = contact_num;
105
+ this.request_date = request_date;
106
+ this.attachment_url = attachment_url;
107
+ this.reporting_manager = reporting_manager;
108
+ this.assigned_to = assigned_to;
109
+ this.status = status;
110
+ this.workflow_execution_id = workflow_execution_id || null;
111
+ this.req_user_department_id = req_user_department_id || null;
112
+ this.req_user_section_id = req_user_section_id || null;
113
+ this.service_type_id = service_type_id || null;
114
+ }
115
115
  }