@platform-modules/civil-aviation-authority 2.3.29 → 2.3.30

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,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
+ }