@platform-modules/civil-aviation-authority 2.3.20 → 2.3.21

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,7 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class ITApprovalSettings extends BaseModel {
3
+ level: number;
4
+ approval_role_id: number;
5
+ workflow_id: number;
6
+ constructor(level: number, approval_role_id: number, workflow_id: number);
7
+ }
@@ -0,0 +1,40 @@
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.ITApprovalSettings = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ let ITApprovalSettings = class ITApprovalSettings extends BaseModel_1.BaseModel {
16
+ constructor(level, approval_role_id, workflow_id) {
17
+ super();
18
+ this.level = level;
19
+ this.approval_role_id = approval_role_id;
20
+ this.workflow_id = workflow_id;
21
+ }
22
+ };
23
+ exports.ITApprovalSettings = ITApprovalSettings;
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
26
+ __metadata("design:type", Number)
27
+ ], ITApprovalSettings.prototype, "level", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
30
+ __metadata("design:type", Number)
31
+ ], ITApprovalSettings.prototype, "approval_role_id", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
34
+ __metadata("design:type", Number)
35
+ ], ITApprovalSettings.prototype, "workflow_id", void 0);
36
+ exports.ITApprovalSettings = ITApprovalSettings = __decorate([
37
+ (0, typeorm_1.Entity)({ name: 'it_approval_settings' }),
38
+ (0, typeorm_1.Unique)(['workflow_id', 'level']),
39
+ __metadata("design:paramtypes", [Number, Number, Number])
40
+ ], ITApprovalSettings);
@@ -0,0 +1,6 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class ITServicesTypesMuscat extends BaseModel {
3
+ name: string;
4
+ name_in_arabic: string;
5
+ constructor(name: string, name_in_arabic: string);
6
+ }
@@ -0,0 +1,34 @@
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.ITServicesTypesMuscat = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ let ITServicesTypesMuscat = class ITServicesTypesMuscat extends BaseModel_1.BaseModel {
16
+ constructor(name, name_in_arabic) {
17
+ super();
18
+ this.name = name;
19
+ this.name_in_arabic = name_in_arabic;
20
+ }
21
+ };
22
+ exports.ITServicesTypesMuscat = ITServicesTypesMuscat;
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ nullable: false }),
25
+ __metadata("design:type", String)
26
+ ], ITServicesTypesMuscat.prototype, "name", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.Column)({ nullable: false }),
29
+ __metadata("design:type", String)
30
+ ], ITServicesTypesMuscat.prototype, "name_in_arabic", void 0);
31
+ exports.ITServicesTypesMuscat = ITServicesTypesMuscat = __decorate([
32
+ (0, typeorm_1.Entity)({ name: 'it_services_types_muscat' }),
33
+ __metadata("design:paramtypes", [String, String])
34
+ ], ITServicesTypesMuscat);
@@ -0,0 +1,6 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class ITServicesTypesSalalah extends BaseModel {
3
+ name: string;
4
+ name_in_arabic: string;
5
+ constructor(name: string, name_in_arabic: string);
6
+ }
@@ -0,0 +1,34 @@
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.ITServicesTypesSalalah = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ let ITServicesTypesSalalah = class ITServicesTypesSalalah extends BaseModel_1.BaseModel {
16
+ constructor(name, name_in_arabic) {
17
+ super();
18
+ this.name = name;
19
+ this.name_in_arabic = name_in_arabic;
20
+ }
21
+ };
22
+ exports.ITServicesTypesSalalah = ITServicesTypesSalalah;
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ nullable: false }),
25
+ __metadata("design:type", String)
26
+ ], ITServicesTypesSalalah.prototype, "name", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.Column)({ nullable: false }),
29
+ __metadata("design:type", String)
30
+ ], ITServicesTypesSalalah.prototype, "name_in_arabic", void 0);
31
+ exports.ITServicesTypesSalalah = ITServicesTypesSalalah = __decorate([
32
+ (0, typeorm_1.Entity)({ name: 'it_services_types_salalah' }),
33
+ __metadata("design:paramtypes", [String, String])
34
+ ], ITServicesTypesSalalah);
@@ -160,7 +160,7 @@ __decorate([
160
160
  __metadata("design:type", String)
161
161
  ], ServiceTransferRequest.prototype, "request_type", void 0);
162
162
  __decorate([
163
- (0, typeorm_1.Column)({ type: "enum", enum: SalaryDetailsType, nullable: false }),
163
+ (0, typeorm_1.Column)({ type: "enum", enum: SalaryDetailsType, default: SalaryDetailsType.NEW, nullable: false }),
164
164
  __metadata("design:type", String)
165
165
  ], ServiceTransferRequest.prototype, "salary_details", void 0);
166
166
  __decorate([
@@ -0,0 +1,9 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class Workflows extends BaseModel {
3
+ name: string;
4
+ service_id: number;
5
+ sub_service_id: number;
6
+ request_for: string;
7
+ levels: number;
8
+ constructor(name: string, service_id: number, sub_service_id: number, request_for: string, levels: number);
9
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // import { Column, Entity, Unique } from "typeorm";
3
+ // import { BaseModel } from './BaseModel';
4
+ // @Entity({ name: 'workflows' })
5
+ // @Unique(['service_id', 'sub_service_id', 'request_for'])
6
+ // export class Workflows extends BaseModel {
7
+ // @Column({ type: 'varchar', length: 100, nullable: false })
8
+ // name: string;
9
+ // @Column({ type: 'bigint', nullable: false })
10
+ // service_id: number;
11
+ // @Column({ type: 'bigint', nullable: false })
12
+ // sub_service_id: number;
13
+ // @Column({ type: 'varchar', length: 20, nullable: false })
14
+ // request_for: string; // 'Self' | 'Behalf of' | 'Internal'
15
+ // @Column({ type: 'int', nullable: false })
16
+ // levels: number;
17
+ // constructor(
18
+ // name: string,
19
+ // service_id: number,
20
+ // sub_service_id: number,
21
+ // request_for: string,
22
+ // levels: number,
23
+ // ) {
24
+ // super();
25
+ // this.name = name;
26
+ // this.service_id = service_id;
27
+ // this.sub_service_id = sub_service_id;
28
+ // this.request_for = request_for;
29
+ // this.levels = levels;
30
+ // }
31
+ // }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/civil-aviation-authority",
3
- "version": "2.3.20",
3
+ "version": "2.3.21",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -1,167 +1,167 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from "./BaseModel";
3
-
4
- export enum HrServiceRequestStatus {
5
- PENDING = "Pending",
6
- ASSIGNED = "Assigned",
7
- IN_PROGRESS = "In Progress",
8
- COMPLETED = "Completed",
9
- APPROVED = "Approved",
10
- REJECTED = "Rejected"
11
- }
12
-
13
- @Entity({ name: "hr_service_requests" })
14
- export class HrServiceRequest extends BaseModel {
15
- @Column({ type: "integer", nullable: true })
16
- req_user_department_id: number | null;
17
-
18
- @Column({ type: "integer", nullable: true })
19
- req_user_section_id: number | null;
20
-
21
- @Column({ type: "integer", nullable: true })
22
- req_user_position_id: number | null;
23
-
24
- @Column({ type: "integer", nullable: true })
25
- service_id: number | null;
26
-
27
- @Column({ type: "integer", nullable: true })
28
- sub_service_id: number | null;
29
-
30
- @Column({ type: "integer", nullable: false })
31
- user_id: number;
32
-
33
- @Column({ type: "text", nullable: true })
34
- description: string | null;
35
-
36
- @Column({ type: "enum", enum: HrServiceRequestStatus, default: HrServiceRequestStatus.PENDING, nullable: false })
37
- status: HrServiceRequestStatus;
38
-
39
- @Column({ type: "integer", nullable: true })
40
- reviewer_user_id: number | null;
41
-
42
- @Column({ type: "integer", nullable: true })
43
- assigned_to_user_id: number | null;
44
-
45
- @Column({ type: "timestamp", nullable: true })
46
- assigned_at: Date | null;
47
-
48
- @Column({ type: "varchar", length: 255, nullable: true })
49
- workflow_execution_id: string | null;
50
-
51
- // Assignment Decision specific fields
52
- @Column({ type: "varchar", length: 255, nullable: false })
53
- assigned_employee_name: string;
54
-
55
- @Column({ type: "varchar", length: 50, nullable: true })
56
- civil_id_card_number: string | null;
57
-
58
- @Column({ type: "varchar", length: 100, nullable: false })
59
- employee_id: string;
60
-
61
- @Column({ type: "varchar", length: 255, nullable: false })
62
- current_job_position: string;
63
-
64
- @Column({ type: "varchar", length: 255, nullable: false })
65
- assigned_job_position: string;
66
-
67
- @Column({ type: "date", nullable: false })
68
- start_date: Date;
69
-
70
- @Column({ type: "date", nullable: false })
71
- end_date: Date;
72
-
73
- @Column({ type: "decimal", precision: 5, scale: 2, nullable: true })
74
- assignment_allowance: number | null; // 0-100 percentage
75
-
76
- @Column({ type: "varchar", length: 20, nullable: false })
77
- phone_number: string;
78
-
79
- @Column({ type: "text", nullable: false })
80
- reason_for_request: string;
81
-
82
- // Replacement tracking fields
83
- @Column({ type: "boolean", default: false, nullable: false })
84
- is_replaced: boolean;
85
-
86
- @Column({ type: "varchar", length: 255, nullable: true })
87
- replacement_employee_name: string | null;
88
-
89
- @Column({ type: "varchar", length: 100, nullable: true })
90
- replacement_employee_id: string | null;
91
-
92
- @Column({ type: "varchar", length: 50, nullable: true })
93
- replacement_civil_id_card_number: string | null;
94
-
95
- @Column({ type: "text", nullable: true })
96
- replacement_reason: string | null;
97
-
98
- @Column({ type: "integer", nullable: true })
99
- replaced_by_user_id: number | null;
100
-
101
- @Column({ type: "timestamp", nullable: true })
102
- replaced_at: Date | null;
103
-
104
- constructor(
105
- user_id: number,
106
- status: HrServiceRequestStatus = HrServiceRequestStatus.PENDING,
107
- service_id?: number | null,
108
- sub_service_id?: number | null,
109
- req_user_department_id?: number | null,
110
- req_user_section_id?: number | null,
111
- req_user_position_id?: number | null,
112
- description?: string | null,
113
- reviewer_user_id?: number | null,
114
- assigned_to_user_id?: number | null,
115
- assigned_at?: Date | null,
116
- workflow_execution_id?: string | null,
117
- assigned_employee_name?: string,
118
- civil_id_card_number?: string | null,
119
- employee_id?: string,
120
- current_job_position?: string,
121
- assigned_job_position?: string,
122
- start_date?: Date,
123
- end_date?: Date,
124
- assignment_allowance?: number | null,
125
- phone_number?: string,
126
- reason_for_request?: string,
127
- is_replaced?: boolean,
128
- replacement_employee_name?: string | null,
129
- replacement_employee_id?: string | null,
130
- replacement_civil_id_card_number?: string | null,
131
- replacement_reason?: string | null,
132
- replaced_by_user_id?: number | null,
133
- replaced_at?: Date | null
134
- ) {
135
- super();
136
- this.user_id = user_id;
137
- this.status = status;
138
- this.service_id = service_id || null;
139
- this.sub_service_id = sub_service_id || null;
140
- this.req_user_department_id = req_user_department_id || null;
141
- this.req_user_section_id = req_user_section_id || null;
142
- this.req_user_position_id = req_user_position_id || null;
143
- this.description = description || null;
144
- this.reviewer_user_id = reviewer_user_id || null;
145
- this.assigned_to_user_id = assigned_to_user_id || null;
146
- this.assigned_at = assigned_at || null;
147
- this.workflow_execution_id = workflow_execution_id || null;
148
- this.assigned_employee_name = assigned_employee_name || "";
149
- this.civil_id_card_number = civil_id_card_number || null;
150
- this.employee_id = employee_id || "";
151
- this.current_job_position = current_job_position || "";
152
- this.assigned_job_position = assigned_job_position || "";
153
- this.start_date = start_date || new Date();
154
- this.end_date = end_date || new Date();
155
- this.assignment_allowance = assignment_allowance || null;
156
- this.phone_number = phone_number || "";
157
- this.reason_for_request = reason_for_request || "";
158
- this.is_replaced = is_replaced || false;
159
- this.replacement_employee_name = replacement_employee_name || null;
160
- this.replacement_employee_id = replacement_employee_id || null;
161
- this.replacement_civil_id_card_number = replacement_civil_id_card_number || null;
162
- this.replacement_reason = replacement_reason || null;
163
- this.replaced_by_user_id = replaced_by_user_id || null;
164
- this.replaced_at = replaced_at || null;
165
- }
166
- }
167
-
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+
4
+ export enum HrServiceRequestStatus {
5
+ PENDING = "Pending",
6
+ ASSIGNED = "Assigned",
7
+ IN_PROGRESS = "In Progress",
8
+ COMPLETED = "Completed",
9
+ APPROVED = "Approved",
10
+ REJECTED = "Rejected"
11
+ }
12
+
13
+ @Entity({ name: "hr_service_requests" })
14
+ export class HrServiceRequest extends BaseModel {
15
+ @Column({ type: "integer", nullable: true })
16
+ req_user_department_id: number | null;
17
+
18
+ @Column({ type: "integer", nullable: true })
19
+ req_user_section_id: number | null;
20
+
21
+ @Column({ type: "integer", nullable: true })
22
+ req_user_position_id: number | null;
23
+
24
+ @Column({ type: "integer", nullable: true })
25
+ service_id: number | null;
26
+
27
+ @Column({ type: "integer", nullable: true })
28
+ sub_service_id: number | null;
29
+
30
+ @Column({ type: "integer", nullable: false })
31
+ user_id: number;
32
+
33
+ @Column({ type: "text", nullable: true })
34
+ description: string | null;
35
+
36
+ @Column({ type: "enum", enum: HrServiceRequestStatus, default: HrServiceRequestStatus.PENDING, nullable: false })
37
+ status: HrServiceRequestStatus;
38
+
39
+ @Column({ type: "integer", nullable: true })
40
+ reviewer_user_id: number | null;
41
+
42
+ @Column({ type: "integer", nullable: true })
43
+ assigned_to_user_id: number | null;
44
+
45
+ @Column({ type: "timestamp", nullable: true })
46
+ assigned_at: Date | null;
47
+
48
+ @Column({ type: "varchar", length: 255, nullable: true })
49
+ workflow_execution_id: string | null;
50
+
51
+ // Assignment Decision specific fields
52
+ @Column({ type: "varchar", length: 255, nullable: false })
53
+ assigned_employee_name: string;
54
+
55
+ @Column({ type: "varchar", length: 50, nullable: true })
56
+ civil_id_card_number: string | null;
57
+
58
+ @Column({ type: "varchar", length: 100, nullable: false })
59
+ employee_id: string;
60
+
61
+ @Column({ type: "varchar", length: 255, nullable: false })
62
+ current_job_position: string;
63
+
64
+ @Column({ type: "varchar", length: 255, nullable: false })
65
+ assigned_job_position: string;
66
+
67
+ @Column({ type: "date", nullable: false })
68
+ start_date: Date;
69
+
70
+ @Column({ type: "date", nullable: false })
71
+ end_date: Date;
72
+
73
+ @Column({ type: "decimal", precision: 5, scale: 2, nullable: true })
74
+ assignment_allowance: number | null; // 0-100 percentage
75
+
76
+ @Column({ type: "varchar", length: 20, nullable: false })
77
+ phone_number: string;
78
+
79
+ @Column({ type: "text", nullable: false })
80
+ reason_for_request: string;
81
+
82
+ // Replacement tracking fields
83
+ @Column({ type: "boolean", default: false, nullable: false })
84
+ is_replaced: boolean;
85
+
86
+ @Column({ type: "varchar", length: 255, nullable: true })
87
+ replacement_employee_name: string | null;
88
+
89
+ @Column({ type: "varchar", length: 100, nullable: true })
90
+ replacement_employee_id: string | null;
91
+
92
+ @Column({ type: "varchar", length: 50, nullable: true })
93
+ replacement_civil_id_card_number: string | null;
94
+
95
+ @Column({ type: "text", nullable: true })
96
+ replacement_reason: string | null;
97
+
98
+ @Column({ type: "integer", nullable: true })
99
+ replaced_by_user_id: number | null;
100
+
101
+ @Column({ type: "timestamp", nullable: true })
102
+ replaced_at: Date | null;
103
+
104
+ constructor(
105
+ user_id: number,
106
+ status: HrServiceRequestStatus = HrServiceRequestStatus.PENDING,
107
+ service_id?: number | null,
108
+ sub_service_id?: number | null,
109
+ req_user_department_id?: number | null,
110
+ req_user_section_id?: number | null,
111
+ req_user_position_id?: number | null,
112
+ description?: string | null,
113
+ reviewer_user_id?: number | null,
114
+ assigned_to_user_id?: number | null,
115
+ assigned_at?: Date | null,
116
+ workflow_execution_id?: string | null,
117
+ assigned_employee_name?: string,
118
+ civil_id_card_number?: string | null,
119
+ employee_id?: string,
120
+ current_job_position?: string,
121
+ assigned_job_position?: string,
122
+ start_date?: Date,
123
+ end_date?: Date,
124
+ assignment_allowance?: number | null,
125
+ phone_number?: string,
126
+ reason_for_request?: string,
127
+ is_replaced?: boolean,
128
+ replacement_employee_name?: string | null,
129
+ replacement_employee_id?: string | null,
130
+ replacement_civil_id_card_number?: string | null,
131
+ replacement_reason?: string | null,
132
+ replaced_by_user_id?: number | null,
133
+ replaced_at?: Date | null
134
+ ) {
135
+ super();
136
+ this.user_id = user_id;
137
+ this.status = status;
138
+ this.service_id = service_id || null;
139
+ this.sub_service_id = sub_service_id || null;
140
+ this.req_user_department_id = req_user_department_id || null;
141
+ this.req_user_section_id = req_user_section_id || null;
142
+ this.req_user_position_id = req_user_position_id || null;
143
+ this.description = description || null;
144
+ this.reviewer_user_id = reviewer_user_id || null;
145
+ this.assigned_to_user_id = assigned_to_user_id || null;
146
+ this.assigned_at = assigned_at || null;
147
+ this.workflow_execution_id = workflow_execution_id || null;
148
+ this.assigned_employee_name = assigned_employee_name || "";
149
+ this.civil_id_card_number = civil_id_card_number || null;
150
+ this.employee_id = employee_id || "";
151
+ this.current_job_position = current_job_position || "";
152
+ this.assigned_job_position = assigned_job_position || "";
153
+ this.start_date = start_date || new Date();
154
+ this.end_date = end_date || new Date();
155
+ this.assignment_allowance = assignment_allowance || null;
156
+ this.phone_number = phone_number || "";
157
+ this.reason_for_request = reason_for_request || "";
158
+ this.is_replaced = is_replaced || false;
159
+ this.replacement_employee_name = replacement_employee_name || null;
160
+ this.replacement_employee_id = replacement_employee_id || null;
161
+ this.replacement_civil_id_card_number = replacement_civil_id_card_number || null;
162
+ this.replacement_reason = replacement_reason || null;
163
+ this.replaced_by_user_id = replaced_by_user_id || null;
164
+ this.replaced_at = replaced_at || null;
165
+ }
166
+ }
167
+
@@ -1,62 +1,62 @@
1
- import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
- import { ITHelpDeskRequests } from './ITHelpDeskModel';
4
- import { User } from './user';
5
-
6
- @Entity({ name: 'it_request_chat' })
7
- export class ITRequestChat extends BaseModel {
8
-
9
- @Column({ type: 'integer', nullable: false })
10
- request_id: number;
11
-
12
- @ManyToOne(() => ITHelpDeskRequests)
13
- @JoinColumn({ name: 'request_id' })
14
- request: ITHelpDeskRequests;
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: 'integer', nullable: false })
23
- user_id: number;
24
-
25
- @ManyToOne(() => User)
26
- @JoinColumn({ name: 'user_id' })
27
- user: User;
28
-
29
- @Column({ type: 'integer', nullable: true })
30
- role_id: number | null;
31
-
32
- @Column({ type: 'text', nullable: false })
33
- message: string;
34
-
35
- @Column({ type: 'text', nullable: true })
36
- status: string | null;
37
-
38
- @Column({ type: 'boolean', default: false })
39
- is_internal: boolean;
40
-
41
- constructor(
42
- request_id: number,
43
- user_id: number,
44
- message: string,
45
- is_internal?: boolean,
46
- service_id?: number | null,
47
- sub_service_id?: number | null,
48
- role_id?: number | null,
49
- status?: string | null
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.user_id = user_id;
56
- this.role_id = role_id || null;
57
- this.message = message;
58
- this.status = status || null;
59
- this.is_internal = is_internal || false;
60
- }
61
- }
62
-
1
+ import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+ import { ITHelpDeskRequests } from './ITHelpDeskModel';
4
+ import { User } from './user';
5
+
6
+ @Entity({ name: 'it_request_chat' })
7
+ export class ITRequestChat extends BaseModel {
8
+
9
+ @Column({ type: 'integer', nullable: false })
10
+ request_id: number;
11
+
12
+ @ManyToOne(() => ITHelpDeskRequests)
13
+ @JoinColumn({ name: 'request_id' })
14
+ request: ITHelpDeskRequests;
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: 'integer', nullable: false })
23
+ user_id: number;
24
+
25
+ @ManyToOne(() => User)
26
+ @JoinColumn({ name: 'user_id' })
27
+ user: User;
28
+
29
+ @Column({ type: 'integer', nullable: true })
30
+ role_id: number | null;
31
+
32
+ @Column({ type: 'text', nullable: false })
33
+ message: string;
34
+
35
+ @Column({ type: 'text', nullable: true })
36
+ status: string | null;
37
+
38
+ @Column({ type: 'boolean', default: false })
39
+ is_internal: boolean;
40
+
41
+ constructor(
42
+ request_id: number,
43
+ user_id: number,
44
+ message: string,
45
+ is_internal?: boolean,
46
+ service_id?: number | null,
47
+ sub_service_id?: number | null,
48
+ role_id?: number | null,
49
+ status?: string | null
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.user_id = user_id;
56
+ this.role_id = role_id || null;
57
+ this.message = message;
58
+ this.status = status || null;
59
+ this.is_internal = is_internal || false;
60
+ }
61
+ }
62
+
@@ -1,85 +1,85 @@
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
- ASSIGNED = "Assigned",
10
- REASSIGNED = "Reassigned"
11
-
12
- }
13
-
14
- @Entity({ name: 'it_approvals' })
15
- export class ItApprovalDetails extends BaseModel {
16
- @Column({ type: 'integer', nullable: false })
17
- request_id: number;
18
-
19
- @Column({ type: 'integer', nullable: true })
20
- service_id: number | null;
21
-
22
- @Column({ type: 'integer', nullable: true })
23
- sub_service_id: number | null;
24
-
25
- @Column({ type: 'integer', nullable: false })
26
- level: number;
27
-
28
- @Column({ type: 'integer', nullable: true })
29
- approver_user_id: number | null;
30
-
31
- @Column({ type: 'integer', nullable: true })
32
- delegation_user_id: number | null;
33
-
34
- @Column({ type: 'integer', nullable: false })
35
- approver_role_id: number | null;
36
-
37
- @Column({ type: 'integer', nullable: true })
38
- department_id: number | null;
39
-
40
- @Column({ type: 'integer', nullable: true })
41
- section_id: number | null;
42
-
43
- @Column({ type: 'integer', nullable: true })
44
- approved_by: number | null;
45
-
46
- @Column({ type: 'varchar', length: 255, nullable: false })
47
- comment: string;
48
-
49
- @Column({ type: 'enum', enum: ApprovalStatus,default: ApprovalStatus.PENDING, nullable: false })
50
- approval_status: ApprovalStatus;
51
-
52
- @Column({ type: 'boolean', default: true, nullable: false })
53
- is_allowed: boolean;
54
-
55
- constructor(
56
- request_id: number,
57
- approver_user_id: number | null,
58
- approver_role_id: number | null,
59
- comment: string,
60
- approval_status: ApprovalStatus,
61
- level: number,
62
- department_id?: number | null,
63
- section_id?: number | null,
64
- approved_by?: number | null,
65
- service_id?: number | null,
66
- sub_service_id?: number | null,
67
- delegation_user_id?: number | null,
68
- is_allowed?: boolean
69
- ) {
70
- super();
71
- this.request_id = request_id;
72
- this.approver_user_id = approver_user_id;
73
- this.approver_role_id = approver_role_id;
74
- this.comment = comment;
75
- this.approval_status = approval_status;
76
- this.level = level;
77
- this.department_id = department_id || null;
78
- this.section_id = section_id || null;
79
- this.approved_by = approved_by || null;
80
- this.service_id = service_id ?? null;
81
- this.sub_service_id = sub_service_id ?? null;
82
- this.delegation_user_id = delegation_user_id || null;
83
- this.is_allowed = is_allowed ?? true;
84
- }
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
+ ASSIGNED = "Assigned",
10
+ REASSIGNED = "Reassigned"
11
+
12
+ }
13
+
14
+ @Entity({ name: 'it_approvals' })
15
+ export class ItApprovalDetails extends BaseModel {
16
+ @Column({ type: 'integer', nullable: false })
17
+ request_id: number;
18
+
19
+ @Column({ type: 'integer', nullable: true })
20
+ service_id: number | null;
21
+
22
+ @Column({ type: 'integer', nullable: true })
23
+ sub_service_id: number | null;
24
+
25
+ @Column({ type: 'integer', nullable: false })
26
+ level: number;
27
+
28
+ @Column({ type: 'integer', nullable: true })
29
+ approver_user_id: number | null;
30
+
31
+ @Column({ type: 'integer', nullable: true })
32
+ delegation_user_id: number | null;
33
+
34
+ @Column({ type: 'integer', nullable: false })
35
+ approver_role_id: number | null;
36
+
37
+ @Column({ type: 'integer', nullable: true })
38
+ department_id: number | null;
39
+
40
+ @Column({ type: 'integer', nullable: true })
41
+ section_id: number | null;
42
+
43
+ @Column({ type: 'integer', nullable: true })
44
+ approved_by: number | null;
45
+
46
+ @Column({ type: 'varchar', length: 255, nullable: false })
47
+ comment: string;
48
+
49
+ @Column({ type: 'enum', enum: ApprovalStatus,default: ApprovalStatus.PENDING, nullable: false })
50
+ approval_status: ApprovalStatus;
51
+
52
+ @Column({ type: 'boolean', default: true, nullable: false })
53
+ is_allowed: boolean;
54
+
55
+ constructor(
56
+ request_id: number,
57
+ approver_user_id: number | null,
58
+ approver_role_id: number | null,
59
+ comment: string,
60
+ approval_status: ApprovalStatus,
61
+ level: number,
62
+ department_id?: number | null,
63
+ section_id?: number | null,
64
+ approved_by?: number | null,
65
+ service_id?: number | null,
66
+ sub_service_id?: number | null,
67
+ delegation_user_id?: number | null,
68
+ is_allowed?: boolean
69
+ ) {
70
+ super();
71
+ this.request_id = request_id;
72
+ this.approver_user_id = approver_user_id;
73
+ this.approver_role_id = approver_role_id;
74
+ this.comment = comment;
75
+ this.approval_status = approval_status;
76
+ this.level = level;
77
+ this.department_id = department_id || null;
78
+ this.section_id = section_id || null;
79
+ this.approved_by = approved_by || null;
80
+ this.service_id = service_id ?? null;
81
+ this.sub_service_id = sub_service_id ?? null;
82
+ this.delegation_user_id = delegation_user_id || null;
83
+ this.is_allowed = is_allowed ?? true;
84
+ }
85
85
  }
@@ -1,56 +1,56 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
-
4
- export enum workFlowStatus {
5
- COMPLETED = "Completed",
6
- NOT_YET_STARTED = "Not Yet Started",
7
- PENDING = "Pending"
8
- }
9
-
10
- //This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
11
- @Entity({ name: 'it_work_flows' })
12
- export class ItWorkFlow extends BaseModel {
13
- @Column({ type: 'int', nullable: false })
14
- request_id: number;
15
-
16
- @Column({ type: 'int', nullable: true })
17
- service_id: number | null;
18
-
19
- @Column({ type: 'int', nullable: true })
20
- sub_service_id: number | null;
21
-
22
- @Column({ type: 'int', nullable: true })
23
- order: number | null;
24
-
25
- @Column({ type: 'varchar', length: 255, nullable: false })
26
- content: string;
27
-
28
- @Column({ type: 'enum', enum: workFlowStatus, default: workFlowStatus.NOT_YET_STARTED, nullable: false })
29
- status: workFlowStatus;
30
-
31
- @Column({ type: 'integer', nullable: true })
32
- user_id: number | null;
33
-
34
- @Column({ type: 'integer', nullable: true })
35
- role_id: number | null;
36
-
37
- @Column({ type: 'integer', nullable: true })
38
- department_id: number | null;
39
-
40
- @Column({ type: 'integer', nullable: true })
41
- section_id: number | null;
42
-
43
- constructor(request_id: number, content: string, status: workFlowStatus, order?: number, service_id?: number | null, sub_service_id?: number | null, user_id?: number | null, role_id?: number | null, department_id?: number | null, section_id?: number | null) {
44
- super();
45
- this.request_id = request_id;
46
- this.content = content;
47
- this.status = status;
48
- this.order = order || null;
49
- this.service_id = service_id ?? null;
50
- this.sub_service_id = sub_service_id ?? null;
51
- this.user_id = user_id || null;
52
- this.role_id = role_id || null;
53
- this.department_id = department_id || null;
54
- this.section_id = section_id || null;
55
- }
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum workFlowStatus {
5
+ COMPLETED = "Completed",
6
+ NOT_YET_STARTED = "Not Yet Started",
7
+ PENDING = "Pending"
8
+ }
9
+
10
+ //This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
11
+ @Entity({ name: 'it_work_flows' })
12
+ export class ItWorkFlow extends BaseModel {
13
+ @Column({ type: 'int', nullable: false })
14
+ request_id: number;
15
+
16
+ @Column({ type: 'int', nullable: true })
17
+ service_id: number | null;
18
+
19
+ @Column({ type: 'int', nullable: true })
20
+ sub_service_id: number | null;
21
+
22
+ @Column({ type: 'int', nullable: true })
23
+ order: number | null;
24
+
25
+ @Column({ type: 'varchar', length: 255, nullable: false })
26
+ content: string;
27
+
28
+ @Column({ type: 'enum', enum: workFlowStatus, default: workFlowStatus.NOT_YET_STARTED, nullable: false })
29
+ status: workFlowStatus;
30
+
31
+ @Column({ type: 'integer', nullable: true })
32
+ user_id: number | null;
33
+
34
+ @Column({ type: 'integer', nullable: true })
35
+ role_id: number | null;
36
+
37
+ @Column({ type: 'integer', nullable: true })
38
+ department_id: number | null;
39
+
40
+ @Column({ type: 'integer', nullable: true })
41
+ section_id: number | null;
42
+
43
+ constructor(request_id: number, content: string, status: workFlowStatus, order?: number, service_id?: number | null, sub_service_id?: number | null, user_id?: number | null, role_id?: number | null, department_id?: number | null, section_id?: number | null) {
44
+ super();
45
+ this.request_id = request_id;
46
+ this.content = content;
47
+ this.status = status;
48
+ this.order = order || null;
49
+ this.service_id = service_id ?? null;
50
+ this.sub_service_id = sub_service_id ?? null;
51
+ this.user_id = user_id || null;
52
+ this.role_id = role_id || null;
53
+ this.department_id = department_id || null;
54
+ this.section_id = section_id || null;
55
+ }
56
56
  }
@@ -97,7 +97,7 @@ export class ServiceTransferRequest extends BaseModel {
97
97
  request_type: ServiceTransferRequestType;
98
98
 
99
99
  // Salary details
100
- @Column({ type: "enum", enum: SalaryDetailsType, nullable: false })
100
+ @Column({ type: "enum", enum: SalaryDetailsType,default: SalaryDetailsType.NEW, nullable: false })
101
101
  salary_details: SalaryDetailsType;
102
102
 
103
103
  @Column({ type: "varchar", length: 500, nullable: true })