@platform-modules/civil-aviation-authority 2.3.25 → 2.3.26

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 CHANGED
@@ -1,17 +1,12 @@
1
- # DB_HOST=localhost
2
- # DB_PORT=5433
3
- # DB_USER=postgres
4
- # DB_PASS=123
5
- # DB_NAME=CAA
6
-
7
1
  # DB_HOST=164.52.222.169
8
- # DB_PORT=5432
2
+ # DB_PORT=5432
9
3
  # DB_USER=postgres_admin_user
10
4
  # DB_PASS=pg_admin_user_pwd_caa_fa_$%^&OIukhjgcvbn
11
5
  # DB_NAME=CAA
12
6
 
13
- DB_HOST=216.48.187.46
14
- DB_PORT=5432
15
- DB_USER=adminuser
16
- DB_PASS=postgres_caa_fm_qa_34567
17
- DB_NAME=CAA_QA
7
+
8
+ DB_HOST=localhost
9
+ DB_PORT=5432
10
+ DB_USER=postgres
11
+ DB_PASS=stevejobs
12
+ DB_NAME=CAA
@@ -0,0 +1,37 @@
1
+ import { BaseModel } from "./BaseModel";
2
+ export declare enum ShiftAllowanceRequestStatus {
3
+ PENDING = "Pending",
4
+ ASSIGNED = "Assigned",
5
+ IN_PROGRESS = "In Progress",
6
+ COMPLETED = "Completed",
7
+ APPROVED = "Approved",
8
+ REJECTED = "Rejected"
9
+ }
10
+ export declare enum ShiftAllowanceValue {
11
+ TWENTY_TWO_PERCENT = "22%",
12
+ THIRTY_PERCENT = "30%",
13
+ SEVENTY_PERCENT = "70%"
14
+ }
15
+ export declare class ShiftAllowanceRequest extends BaseModel {
16
+ req_user_department_id: number | null;
17
+ req_user_section_id: number | null;
18
+ req_user_position_id: number | null;
19
+ service_id: number | null;
20
+ sub_service_id: number | null;
21
+ user_id: number;
22
+ description: string | null;
23
+ status: ShiftAllowanceRequestStatus;
24
+ reviewer_user_id: number | null;
25
+ assigned_to_user_id: number | null;
26
+ assigned_at: Date | null;
27
+ workflow_execution_id: string | null;
28
+ employee_name: string;
29
+ employee_id: string;
30
+ job_title: string;
31
+ financial_grade: string;
32
+ allowance_value: ShiftAllowanceValue;
33
+ shift_start_date: Date;
34
+ shift_end_date: Date;
35
+ reason_for_request: string | null;
36
+ constructor(user_id: number, status?: ShiftAllowanceRequestStatus, service_id?: number | null, sub_service_id?: number | null, req_user_department_id?: number | null, req_user_section_id?: number | null, req_user_position_id?: number | null, description?: string | null, reviewer_user_id?: number | null, assigned_to_user_id?: number | null, assigned_at?: Date | null, workflow_execution_id?: string | null, employee_name?: string, employee_id?: string, job_title?: string, financial_grade?: string, allowance_value?: ShiftAllowanceValue, shift_start_date?: Date, shift_end_date?: Date, reason_for_request?: string | null);
37
+ }
@@ -0,0 +1,140 @@
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.ShiftAllowanceRequest = exports.ShiftAllowanceValue = exports.ShiftAllowanceRequestStatus = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ var ShiftAllowanceRequestStatus;
16
+ (function (ShiftAllowanceRequestStatus) {
17
+ ShiftAllowanceRequestStatus["PENDING"] = "Pending";
18
+ ShiftAllowanceRequestStatus["ASSIGNED"] = "Assigned";
19
+ ShiftAllowanceRequestStatus["IN_PROGRESS"] = "In Progress";
20
+ ShiftAllowanceRequestStatus["COMPLETED"] = "Completed";
21
+ ShiftAllowanceRequestStatus["APPROVED"] = "Approved";
22
+ ShiftAllowanceRequestStatus["REJECTED"] = "Rejected";
23
+ })(ShiftAllowanceRequestStatus || (exports.ShiftAllowanceRequestStatus = ShiftAllowanceRequestStatus = {}));
24
+ var ShiftAllowanceValue;
25
+ (function (ShiftAllowanceValue) {
26
+ ShiftAllowanceValue["TWENTY_TWO_PERCENT"] = "22%";
27
+ ShiftAllowanceValue["THIRTY_PERCENT"] = "30%";
28
+ ShiftAllowanceValue["SEVENTY_PERCENT"] = "70%";
29
+ })(ShiftAllowanceValue || (exports.ShiftAllowanceValue = ShiftAllowanceValue = {}));
30
+ let ShiftAllowanceRequest = class ShiftAllowanceRequest extends BaseModel_1.BaseModel {
31
+ constructor(user_id, status = ShiftAllowanceRequestStatus.PENDING, service_id, sub_service_id, req_user_department_id, req_user_section_id, req_user_position_id, description, reviewer_user_id, assigned_to_user_id, assigned_at, workflow_execution_id, employee_name, employee_id, job_title, financial_grade, allowance_value, shift_start_date, shift_end_date, reason_for_request) {
32
+ super();
33
+ this.user_id = user_id;
34
+ this.status = status;
35
+ this.service_id = service_id || null;
36
+ this.sub_service_id = sub_service_id || null;
37
+ this.req_user_department_id = req_user_department_id || null;
38
+ this.req_user_section_id = req_user_section_id || null;
39
+ this.req_user_position_id = req_user_position_id || null;
40
+ this.description = description || null;
41
+ this.reviewer_user_id = reviewer_user_id || null;
42
+ this.assigned_to_user_id = assigned_to_user_id || null;
43
+ this.assigned_at = assigned_at || null;
44
+ this.workflow_execution_id = workflow_execution_id || null;
45
+ this.employee_name = employee_name || "";
46
+ this.employee_id = employee_id || "";
47
+ this.job_title = job_title || "";
48
+ this.financial_grade = financial_grade || "";
49
+ this.allowance_value = allowance_value || ShiftAllowanceValue.TWENTY_TWO_PERCENT;
50
+ this.shift_start_date = shift_start_date || new Date();
51
+ this.shift_end_date = shift_end_date || new Date();
52
+ this.reason_for_request = reason_for_request || null;
53
+ }
54
+ };
55
+ exports.ShiftAllowanceRequest = ShiftAllowanceRequest;
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ type: "integer", nullable: true }),
58
+ __metadata("design:type", Object)
59
+ ], ShiftAllowanceRequest.prototype, "req_user_department_id", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Column)({ type: "integer", nullable: true }),
62
+ __metadata("design:type", Object)
63
+ ], ShiftAllowanceRequest.prototype, "req_user_section_id", void 0);
64
+ __decorate([
65
+ (0, typeorm_1.Column)({ type: "integer", nullable: true }),
66
+ __metadata("design:type", Object)
67
+ ], ShiftAllowanceRequest.prototype, "req_user_position_id", void 0);
68
+ __decorate([
69
+ (0, typeorm_1.Column)({ type: "integer", nullable: true }),
70
+ __metadata("design:type", Object)
71
+ ], ShiftAllowanceRequest.prototype, "service_id", void 0);
72
+ __decorate([
73
+ (0, typeorm_1.Column)({ type: "integer", nullable: true }),
74
+ __metadata("design:type", Object)
75
+ ], ShiftAllowanceRequest.prototype, "sub_service_id", void 0);
76
+ __decorate([
77
+ (0, typeorm_1.Column)({ type: "integer", nullable: false }),
78
+ __metadata("design:type", Number)
79
+ ], ShiftAllowanceRequest.prototype, "user_id", void 0);
80
+ __decorate([
81
+ (0, typeorm_1.Column)({ type: "text", nullable: true }),
82
+ __metadata("design:type", Object)
83
+ ], ShiftAllowanceRequest.prototype, "description", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.Column)({ type: "enum", enum: ShiftAllowanceRequestStatus, default: ShiftAllowanceRequestStatus.PENDING, nullable: false }),
86
+ __metadata("design:type", String)
87
+ ], ShiftAllowanceRequest.prototype, "status", void 0);
88
+ __decorate([
89
+ (0, typeorm_1.Column)({ type: "integer", nullable: true }),
90
+ __metadata("design:type", Object)
91
+ ], ShiftAllowanceRequest.prototype, "reviewer_user_id", void 0);
92
+ __decorate([
93
+ (0, typeorm_1.Column)({ type: "integer", nullable: true }),
94
+ __metadata("design:type", Object)
95
+ ], ShiftAllowanceRequest.prototype, "assigned_to_user_id", void 0);
96
+ __decorate([
97
+ (0, typeorm_1.Column)({ type: "timestamp", nullable: true }),
98
+ __metadata("design:type", Object)
99
+ ], ShiftAllowanceRequest.prototype, "assigned_at", void 0);
100
+ __decorate([
101
+ (0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
102
+ __metadata("design:type", Object)
103
+ ], ShiftAllowanceRequest.prototype, "workflow_execution_id", void 0);
104
+ __decorate([
105
+ (0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: false }),
106
+ __metadata("design:type", String)
107
+ ], ShiftAllowanceRequest.prototype, "employee_name", void 0);
108
+ __decorate([
109
+ (0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: false }),
110
+ __metadata("design:type", String)
111
+ ], ShiftAllowanceRequest.prototype, "employee_id", void 0);
112
+ __decorate([
113
+ (0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: false }),
114
+ __metadata("design:type", String)
115
+ ], ShiftAllowanceRequest.prototype, "job_title", void 0);
116
+ __decorate([
117
+ (0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: false }),
118
+ __metadata("design:type", String)
119
+ ], ShiftAllowanceRequest.prototype, "financial_grade", void 0);
120
+ __decorate([
121
+ (0, typeorm_1.Column)({ type: "enum", enum: ShiftAllowanceValue, nullable: false }),
122
+ __metadata("design:type", String)
123
+ ], ShiftAllowanceRequest.prototype, "allowance_value", void 0);
124
+ __decorate([
125
+ (0, typeorm_1.Column)({ type: "date", nullable: false }),
126
+ __metadata("design:type", Date)
127
+ ], ShiftAllowanceRequest.prototype, "shift_start_date", void 0);
128
+ __decorate([
129
+ (0, typeorm_1.Column)({ type: "date", nullable: false }),
130
+ __metadata("design:type", Date)
131
+ ], ShiftAllowanceRequest.prototype, "shift_end_date", void 0);
132
+ __decorate([
133
+ (0, typeorm_1.Column)({ type: "text", nullable: true }),
134
+ __metadata("design:type", Object)
135
+ ], ShiftAllowanceRequest.prototype, "reason_for_request", void 0);
136
+ exports.ShiftAllowanceRequest = ShiftAllowanceRequest = __decorate([
137
+ (0, typeorm_1.Entity)({ name: "shift_allowance_requests" }),
138
+ __metadata("design:paramtypes", [Number, String, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, String, String, String, String, String, Date,
139
+ Date, Object])
140
+ ], ShiftAllowanceRequest);
@@ -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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/civil-aviation-authority",
3
- "version": "2.3.25",
3
+ "version": "2.3.26",
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
+
@@ -0,0 +1,126 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+
4
+ export enum ShiftAllowanceRequestStatus {
5
+ PENDING = "Pending",
6
+ ASSIGNED = "Assigned",
7
+ IN_PROGRESS = "In Progress",
8
+ COMPLETED = "Completed",
9
+ APPROVED = "Approved",
10
+ REJECTED = "Rejected"
11
+ }
12
+
13
+ export enum ShiftAllowanceValue {
14
+ TWENTY_TWO_PERCENT = "22%",
15
+ THIRTY_PERCENT = "30%",
16
+ SEVENTY_PERCENT = "70%"
17
+ }
18
+
19
+ @Entity({ name: "shift_allowance_requests" })
20
+ export class ShiftAllowanceRequest extends BaseModel {
21
+ @Column({ type: "integer", nullable: true })
22
+ req_user_department_id: number | null;
23
+
24
+ @Column({ type: "integer", nullable: true })
25
+ req_user_section_id: number | null;
26
+
27
+ @Column({ type: "integer", nullable: true })
28
+ req_user_position_id: number | null;
29
+
30
+ @Column({ type: "integer", nullable: true })
31
+ service_id: number | null;
32
+
33
+ @Column({ type: "integer", nullable: true })
34
+ sub_service_id: number | null;
35
+
36
+ @Column({ type: "integer", nullable: false })
37
+ user_id: number;
38
+
39
+ @Column({ type: "text", nullable: true })
40
+ description: string | null;
41
+
42
+ @Column({ type: "enum", enum: ShiftAllowanceRequestStatus, default: ShiftAllowanceRequestStatus.PENDING, nullable: false })
43
+ status: ShiftAllowanceRequestStatus;
44
+
45
+ @Column({ type: "integer", nullable: true })
46
+ reviewer_user_id: number | null;
47
+
48
+ @Column({ type: "integer", nullable: true })
49
+ assigned_to_user_id: number | null;
50
+
51
+ @Column({ type: "timestamp", nullable: true })
52
+ assigned_at: Date | null;
53
+
54
+ @Column({ type: "varchar", length: 255, nullable: true })
55
+ workflow_execution_id: string | null;
56
+
57
+ // Shift Allowance specific fields
58
+ @Column({ type: "varchar", length: 255, nullable: false })
59
+ employee_name: string;
60
+
61
+ @Column({ type: "varchar", length: 100, nullable: false })
62
+ employee_id: string;
63
+
64
+ @Column({ type: "varchar", length: 255, nullable: false })
65
+ job_title: string;
66
+
67
+ @Column({ type: "varchar", length: 100, nullable: false })
68
+ financial_grade: string;
69
+
70
+ @Column({ type: "enum", enum: ShiftAllowanceValue, nullable: false })
71
+ allowance_value: ShiftAllowanceValue;
72
+
73
+ @Column({ type: "date", nullable: false })
74
+ shift_start_date: Date;
75
+
76
+ @Column({ type: "date", nullable: false })
77
+ shift_end_date: Date;
78
+
79
+ @Column({ type: "text", nullable: true })
80
+ reason_for_request: string | null;
81
+
82
+ constructor(
83
+ user_id: number,
84
+ status: ShiftAllowanceRequestStatus = ShiftAllowanceRequestStatus.PENDING,
85
+ service_id?: number | null,
86
+ sub_service_id?: number | null,
87
+ req_user_department_id?: number | null,
88
+ req_user_section_id?: number | null,
89
+ req_user_position_id?: number | null,
90
+ description?: string | null,
91
+ reviewer_user_id?: number | null,
92
+ assigned_to_user_id?: number | null,
93
+ assigned_at?: Date | null,
94
+ workflow_execution_id?: string | null,
95
+ employee_name?: string,
96
+ employee_id?: string,
97
+ job_title?: string,
98
+ financial_grade?: string,
99
+ allowance_value?: ShiftAllowanceValue,
100
+ shift_start_date?: Date,
101
+ shift_end_date?: Date,
102
+ reason_for_request?: string | null
103
+ ) {
104
+ super();
105
+ this.user_id = user_id;
106
+ this.status = status;
107
+ this.service_id = service_id || null;
108
+ this.sub_service_id = sub_service_id || null;
109
+ this.req_user_department_id = req_user_department_id || null;
110
+ this.req_user_section_id = req_user_section_id || null;
111
+ this.req_user_position_id = req_user_position_id || null;
112
+ this.description = description || null;
113
+ this.reviewer_user_id = reviewer_user_id || null;
114
+ this.assigned_to_user_id = assigned_to_user_id || null;
115
+ this.assigned_at = assigned_at || null;
116
+ this.workflow_execution_id = workflow_execution_id || null;
117
+ this.employee_name = employee_name || "";
118
+ this.employee_id = employee_id || "";
119
+ this.job_title = job_title || "";
120
+ this.financial_grade = financial_grade || "";
121
+ this.allowance_value = allowance_value || ShiftAllowanceValue.TWENTY_TWO_PERCENT;
122
+ this.shift_start_date = shift_start_date || new Date();
123
+ this.shift_end_date = shift_end_date || new Date();
124
+ this.reason_for_request = reason_for_request || null;
125
+ }
126
+ }