@platform-modules/civil-aviation-authority 2.3.325 → 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.325",
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;
@@ -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