@platform-modules/civil-aviation-authority 2.3.320 → 2.3.327

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/civil-aviation-authority",
3
- "version": "2.3.320",
3
+ "version": "2.3.327",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -0,0 +1,18 @@
1
+ -- Study leave: type of study, type of leave, and Records reference number.
2
+ -- Run once per environment. HR and Conductor use synchronize: false.
3
+
4
+ ALTER TABLE IF EXISTS study_leave_requests
5
+ ADD COLUMN IF NOT EXISTS type_of_study VARCHAR(50) NULL;
6
+
7
+ ALTER TABLE IF EXISTS study_leave_requests
8
+ ADD COLUMN IF NOT EXISTS type_of_study_other VARCHAR(255) NULL;
9
+
10
+ ALTER TABLE IF EXISTS study_leave_requests
11
+ ADD COLUMN IF NOT EXISTS type_of_leave VARCHAR(50) NULL;
12
+
13
+ ALTER TABLE IF EXISTS study_leave_requests
14
+ ADD COLUMN IF NOT EXISTS reference_number VARCHAR(20) NULL;
15
+
16
+ CREATE UNIQUE INDEX IF NOT EXISTS uq_study_leave_requests_reference_number
17
+ ON study_leave_requests (reference_number)
18
+ WHERE reference_number IS NOT NULL;
@@ -0,0 +1,9 @@
1
+ -- Reference number for Request Training, assigned when the request reaches Records Department.
2
+ -- Run once per environment. HR and Conductor use synchronize: false.
3
+
4
+ ALTER TABLE IF EXISTS training_requests
5
+ ADD COLUMN IF NOT EXISTS reference_number VARCHAR(20) NULL;
6
+
7
+ CREATE UNIQUE INDEX IF NOT EXISTS uq_training_requests_reference_number
8
+ ON training_requests (reference_number)
9
+ WHERE reference_number IS NOT NULL;
@@ -9,6 +9,18 @@ export enum StudyLeaveRequestStatus {
9
9
  REJECTED = "Rejected"
10
10
  }
11
11
 
12
+ export enum TypeOfStudy {
13
+ SCHOLARSHIP = "Scholarship",
14
+ SELF_FUNDED = "Self-funded",
15
+ OTHER = "Other"
16
+ }
17
+
18
+ export enum TypeOfLeave {
19
+ PARTIAL = "Partial",
20
+ FULL = "Full",
21
+ OTHER = "Other"
22
+ }
23
+
12
24
  @Entity({ name: "study_leave_requests" })
13
25
  export class StudyLeaveRequest extends BaseModel {
14
26
  @Column({ type: "integer", nullable: true })
@@ -88,6 +100,19 @@ export class StudyLeaveRequest extends BaseModel {
88
100
  @Column({ type: "varchar", length: 255, nullable: true })
89
101
  scholarship: string | null;
90
102
 
103
+ @Column({ type: "varchar", length: 50, nullable: true })
104
+ type_of_study: TypeOfStudy | null;
105
+
106
+ @Column({ type: "varchar", length: 255, nullable: true })
107
+ type_of_study_other: string | null;
108
+
109
+ @Column({ type: "varchar", length: 50, nullable: true })
110
+ type_of_leave: TypeOfLeave | null;
111
+
112
+ /** Assigned when the request reaches Records approval, e.g. SL00001. */
113
+ @Column({ type: "varchar", length: 20, nullable: true, unique: true })
114
+ reference_number: string | null;
115
+
91
116
  constructor(
92
117
  user_id: number,
93
118
  course_name: string,
@@ -139,6 +164,10 @@ export class StudyLeaveRequest extends BaseModel {
139
164
  this.qualification_required = qualification_required ?? null;
140
165
  this.have_you_ever_received_authority = have_you_ever_received_authority ?? null;
141
166
  this.scholarship = scholarship ?? null;
167
+ this.type_of_study = null;
168
+ this.type_of_study_other = null;
169
+ this.type_of_leave = null;
170
+ this.reference_number = null;
142
171
  }
143
172
  }
144
173
 
@@ -112,6 +112,10 @@ export class TrainingRequest extends BaseModel {
112
112
  @Column({ type: "varchar", length: 255, nullable: true })
113
113
  workflow_execution_id: string | null;
114
114
 
115
+ /** Assigned when the request reaches Records Department approval, e.g. RT00001. */
116
+ @Column({ type: "varchar", length: 20, nullable: true, unique: true })
117
+ reference_number: string | null;
118
+
115
119
  constructor(
116
120
  user_id: number,
117
121
  type_of_training: TypeOfTraining | null,
@@ -159,6 +163,7 @@ export class TrainingRequest extends BaseModel {
159
163
  this.assigned_to_user_id = assigned_to_user_id || null;
160
164
  this.assigned_at = assigned_at || null;
161
165
  this.workflow_execution_id = workflow_execution_id || null;
166
+ this.reference_number = null;
162
167
  }
163
168
  }
164
169