@platform-modules/civil-aviation-authority 2.2.307 → 2.2.309

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,148 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+
4
+ export enum TrainingRequestStatus {
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 TypeOfTraining {
14
+ INSIDE_TRAINING = "Inside Training",
15
+ OUTSIDE_TRAINING = "Outside Training"
16
+ }
17
+
18
+ export enum TypeOfCategory {
19
+ PLANNED = "Planned",
20
+ OUT_OF_PLANNED = "Out of planned"
21
+ }
22
+
23
+ export enum TrainingMediaCoverageRequired {
24
+ YES = "Yes",
25
+ NO = "No"
26
+ }
27
+
28
+ @Entity({ name: "training_requests" })
29
+ export class TrainingRequest extends BaseModel {
30
+ @Column({ type: "integer", nullable: true })
31
+ req_user_department_id: number | null;
32
+
33
+ @Column({ type: "integer", nullable: true })
34
+ req_user_section_id: number | null;
35
+
36
+ @Column({ type: "integer", nullable: true })
37
+ req_user_position_id: number | null;
38
+
39
+ @Column({ type: "integer", nullable: true })
40
+ service_id: number | null;
41
+
42
+ @Column({ type: "integer", nullable: true })
43
+ sub_service_id: number | null;
44
+
45
+ @Column({ type: "integer", nullable: false })
46
+ user_id: number;
47
+
48
+ @Column({
49
+ type: "enum",
50
+ enum: TypeOfTraining,
51
+ nullable: false
52
+ })
53
+ type_of_training: TypeOfTraining;
54
+
55
+ @Column({
56
+ type: "enum",
57
+ enum: TypeOfCategory,
58
+ nullable: true
59
+ })
60
+ type_of_category: TypeOfCategory | null;
61
+
62
+ @Column({ type: "text", nullable: false })
63
+ description: string;
64
+
65
+ @Column({ type: "date", nullable: true })
66
+ start_date: Date | null;
67
+
68
+ @Column({ type: "date", nullable: true })
69
+ end_date: Date | null;
70
+
71
+ @Column({ type: "varchar", length: 255, nullable: false })
72
+ place: string;
73
+
74
+ @Column({ type: "integer", nullable: false })
75
+ no_of_attendees: number;
76
+
77
+ @Column({
78
+ type: "enum",
79
+ enum: TrainingMediaCoverageRequired,
80
+ default: TrainingMediaCoverageRequired.NO,
81
+ nullable: false
82
+ })
83
+ media_coverage_required: TrainingMediaCoverageRequired;
84
+
85
+ @Column({
86
+ type: "enum",
87
+ enum: TrainingRequestStatus,
88
+ default: TrainingRequestStatus.PENDING,
89
+ nullable: false
90
+ })
91
+ status: TrainingRequestStatus;
92
+
93
+ @Column({ type: "integer", nullable: true })
94
+ reviewer_user_id: number | null;
95
+
96
+ @Column({ type: "integer", nullable: true })
97
+ assigned_to_user_id: number | null;
98
+
99
+ @Column({ type: "timestamp", nullable: true })
100
+ assigned_at: Date | null;
101
+
102
+ @Column({ type: "varchar", length: 255, nullable: true })
103
+ workflow_execution_id: string | null;
104
+
105
+ constructor(
106
+ user_id: number,
107
+ type_of_training: TypeOfTraining,
108
+ description: string,
109
+ place: string,
110
+ no_of_attendees: number,
111
+ media_coverage_required: TrainingMediaCoverageRequired,
112
+ status: TrainingRequestStatus = TrainingRequestStatus.PENDING,
113
+ service_id?: number | null,
114
+ sub_service_id?: number | null,
115
+ req_user_department_id?: number | null,
116
+ req_user_section_id?: number | null,
117
+ req_user_position_id?: number | null,
118
+ type_of_category?: TypeOfCategory | null,
119
+ start_date?: Date | null,
120
+ end_date?: Date | null,
121
+ reviewer_user_id?: number | null,
122
+ assigned_to_user_id?: number | null,
123
+ assigned_at?: Date | null,
124
+ workflow_execution_id?: string | null
125
+ ) {
126
+ super();
127
+ this.user_id = user_id;
128
+ this.type_of_training = type_of_training;
129
+ this.description = description;
130
+ this.place = place;
131
+ this.no_of_attendees = no_of_attendees;
132
+ this.media_coverage_required = media_coverage_required;
133
+ this.status = status;
134
+ this.service_id = service_id || null;
135
+ this.sub_service_id = sub_service_id || null;
136
+ this.req_user_department_id = req_user_department_id || null;
137
+ this.req_user_section_id = req_user_section_id || null;
138
+ this.req_user_position_id = req_user_position_id || null;
139
+ this.type_of_category = type_of_category || null;
140
+ this.start_date = start_date || null;
141
+ this.end_date = end_date || null;
142
+ this.reviewer_user_id = reviewer_user_id || null;
143
+ this.assigned_to_user_id = assigned_to_user_id || null;
144
+ this.assigned_at = assigned_at || null;
145
+ this.workflow_execution_id = workflow_execution_id || null;
146
+ }
147
+ }
148
+