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

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.325",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -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;
@@ -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