@platform-modules/civil-aviation-authority 1.0.57 → 2.0.0
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/.env +3 -9
- package/dist/data-source.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/models/BaseModel.d.ts +2 -2
- package/dist/models/BaseModel.js +4 -6
- package/dist/models/CAASubServices.d.ts +2 -0
- package/dist/models/CAASubServices.js +6 -0
- package/dist/models/ITHelpDeskModel.d.ts +8 -3
- package/dist/models/ITHelpDeskModel.js +39 -22
- package/dist/models/ItApprovalsModel.d.ts +5 -2
- package/dist/models/ItApprovalsModel.js +22 -7
- package/dist/models/ServiceTypeModel.d.ts +14 -0
- package/dist/models/ServiceTypeModel.js +66 -0
- package/dist/models/WorkflowDefinitions.d.ts +8 -2
- package/dist/models/WorkflowDefinitions.js +31 -4
- package/dist/models/WorkflowHierarchy.d.ts +6 -2
- package/dist/models/WorkflowHierarchy.js +24 -4
- package/package.json +1 -1
- package/src/data-source.ts +70 -68
- package/src/index.ts +26 -25
- package/src/models/BaseModel.ts +46 -46
- package/src/models/CAASubServices.ts +6 -1
- package/src/models/ITHelpDeskModel.ts +114 -97
- package/src/models/ItApprovalsModel.ts +61 -39
- package/src/models/ServiceTypeModel.ts +52 -0
- package/src/models/WorkflowDefinitions.ts +32 -6
- package/src/models/WorkflowHierarchy.ts +24 -4
- package/dist/models/ITServicesTypesModel.d.ts +0 -5
- package/dist/models/ITServicesTypesModel.js +0 -29
package/src/data-source.ts
CHANGED
|
@@ -1,68 +1,70 @@
|
|
|
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 {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export const AppDataSource = new DataSource({
|
|
35
|
+
type: 'postgres',
|
|
36
|
+
host: process.env.DB_HOST || 'localhost',
|
|
37
|
+
port: +(process.env.DB_PORT || 5432),
|
|
38
|
+
username: process.env.DB_USER || 'postgres',
|
|
39
|
+
password: process.env.DB_PASS || 'postgres',
|
|
40
|
+
database: process.env.DB_NAME || 'common_models',
|
|
41
|
+
synchronize: true, // auto-create tables (disable in prod)
|
|
42
|
+
logging: false,
|
|
43
|
+
entities: [
|
|
44
|
+
User,userSessions,
|
|
45
|
+
Role,
|
|
46
|
+
ITHelpDeskRequests,
|
|
47
|
+
ITServicesTypesSalalah,
|
|
48
|
+
ITServicesTypesMuscat,
|
|
49
|
+
ServiceType,
|
|
50
|
+
CAAServices,
|
|
51
|
+
CAASubServices,
|
|
52
|
+
ITApprovalSettings,
|
|
53
|
+
// Workflows,
|
|
54
|
+
ItApprovalDetails,
|
|
55
|
+
ItWorkFlow,
|
|
56
|
+
WorkflowDefinitions,
|
|
57
|
+
WorkflowTask,
|
|
58
|
+
Departments,
|
|
59
|
+
Sections,
|
|
60
|
+
WorkflowHierarchy,
|
|
61
|
+
WorkflowTaskNames,
|
|
62
|
+
Directorate,
|
|
63
|
+
Position,
|
|
64
|
+
ServiceBookmarks,
|
|
65
|
+
ContactInfo,
|
|
66
|
+
UserRole,
|
|
67
|
+
RoleRights,
|
|
68
|
+
Notification
|
|
69
|
+
],
|
|
70
|
+
});
|
package/src/index.ts
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
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/
|
|
8
|
-
export * from './models/
|
|
9
|
-
export * from './models/
|
|
10
|
-
|
|
11
|
-
export * from './models/
|
|
12
|
-
export * from './models/
|
|
13
|
-
export * from './models/
|
|
14
|
-
export * from './models/
|
|
15
|
-
export * from './models/
|
|
16
|
-
export * from './models/
|
|
17
|
-
export * from './models/
|
|
18
|
-
export * from './models/
|
|
19
|
-
export * from './models/
|
|
20
|
-
export * from './models/
|
|
21
|
-
export * from './models/
|
|
22
|
-
export * from './models/
|
|
23
|
-
export * from './models/
|
|
24
|
-
export * from './models/
|
|
25
|
-
export * from './models/
|
|
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';
|
package/src/models/BaseModel.ts
CHANGED
|
@@ -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({ nullable:
|
|
14
|
-
created_by?:
|
|
15
|
-
|
|
16
|
-
@CreateDateColumn({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" })
|
|
17
|
-
created_at?: Date;
|
|
18
|
-
|
|
19
|
-
@Column({ nullable: true })
|
|
20
|
-
updated_by?:
|
|
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
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
|
|
3
3
|
import { BaseModel } from './BaseModel';
|
|
4
|
+
import { CAAServices } from './CAAServices';
|
|
4
5
|
|
|
5
6
|
@Entity({ name: 'caa_sub_services' })
|
|
6
7
|
export class CAASubServices extends BaseModel {
|
|
@@ -17,6 +18,10 @@ export class CAASubServices extends BaseModel {
|
|
|
17
18
|
@Column({ nullable: true })
|
|
18
19
|
service_id: number;
|
|
19
20
|
|
|
21
|
+
@ManyToOne(() => CAAServices)
|
|
22
|
+
@JoinColumn({ name: 'service_id' })
|
|
23
|
+
service: CAAServices;
|
|
24
|
+
|
|
20
25
|
@Column({ nullable: true })
|
|
21
26
|
logo_url: string;
|
|
22
27
|
|
|
@@ -1,98 +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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
@Column({ nullable: false })
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@Column({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
@Column({
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
+
}
|
|
98
115
|
}
|
|
@@ -1,40 +1,62 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export enum ApprovalStatus {
|
|
6
|
-
PENDING = "Pending",
|
|
7
|
-
APPROVED = "Approved",
|
|
8
|
-
REJECTED = "Rejected"
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@Entity({ name: 'it_approvals' })
|
|
12
|
-
export class ItApprovalDetails extends BaseModel {
|
|
13
|
-
@Column({ type: '
|
|
14
|
-
request_id: number;
|
|
15
|
-
|
|
16
|
-
@Column({ type: '
|
|
17
|
-
level: number;
|
|
18
|
-
|
|
19
|
-
@Column({ type: '
|
|
20
|
-
approver_user_id: number;
|
|
21
|
-
|
|
22
|
-
@Column({ type: '
|
|
23
|
-
approver_role_id: number;
|
|
24
|
-
|
|
25
|
-
@Column({ type: '
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@Column({ type: '
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export enum ApprovalStatus {
|
|
6
|
+
PENDING = "Pending",
|
|
7
|
+
APPROVED = "Approved",
|
|
8
|
+
REJECTED = "Rejected"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Entity({ name: 'it_approvals' })
|
|
12
|
+
export class ItApprovalDetails extends BaseModel {
|
|
13
|
+
@Column({ type: 'integer', nullable: false })
|
|
14
|
+
request_id: number;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'integer', nullable: false })
|
|
17
|
+
level: number;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'integer', nullable: true })
|
|
20
|
+
approver_user_id: number | null;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'integer', nullable: false })
|
|
23
|
+
approver_role_id: number;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'integer', nullable: true })
|
|
26
|
+
department_id: number | null;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'integer', nullable: true })
|
|
29
|
+
section_id: number | null;
|
|
30
|
+
|
|
31
|
+
@Column({ type: 'integer', nullable: true })
|
|
32
|
+
approved_by: number | null;
|
|
33
|
+
|
|
34
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
35
|
+
comment: string;
|
|
36
|
+
|
|
37
|
+
@Column({ type: 'enum', enum: ApprovalStatus,default: ApprovalStatus.PENDING, nullable: false })
|
|
38
|
+
approval_status: ApprovalStatus;
|
|
39
|
+
|
|
40
|
+
constructor(
|
|
41
|
+
request_id: number,
|
|
42
|
+
approver_user_id: number | null,
|
|
43
|
+
approver_role_id: number,
|
|
44
|
+
comment: string,
|
|
45
|
+
approval_status: ApprovalStatus,
|
|
46
|
+
level: number,
|
|
47
|
+
department_id?: number | null,
|
|
48
|
+
section_id?: number | null,
|
|
49
|
+
approved_by?: number | null
|
|
50
|
+
) {
|
|
51
|
+
super();
|
|
52
|
+
this.request_id = request_id;
|
|
53
|
+
this.approver_user_id = approver_user_id;
|
|
54
|
+
this.approver_role_id = approver_role_id;
|
|
55
|
+
this.comment = comment;
|
|
56
|
+
this.approval_status = approval_status;
|
|
57
|
+
this.level = level;
|
|
58
|
+
this.department_id = department_id || null;
|
|
59
|
+
this.section_id = section_id || null;
|
|
60
|
+
this.approved_by = approved_by || null;
|
|
61
|
+
}
|
|
40
62
|
}
|