@platform-modules/civil-aviation-authority 2.3.159 → 2.3.161

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.
@@ -105,6 +105,7 @@ const DocumentDriveModel_1 = require("./models/DocumentDriveModel");
105
105
  const DocumentTypeModel_1 = require("./models/DocumentTypeModel");
106
106
  const DocumentPermissionModel_1 = require("./models/DocumentPermissionModel");
107
107
  const DocumentAuditLogModel_1 = require("./models/DocumentAuditLogModel");
108
+ const DocumentVersionModel_1 = require("./models/DocumentVersionModel");
108
109
  const DocumentAccessModel_1 = require("./models/DocumentAccessModel");
109
110
  const DepartmentDocumentOwnerModel_1 = require("./models/DepartmentDocumentOwnerModel");
110
111
  const TrainingWorkflowModel_1 = require("./models/TrainingWorkflowModel");
@@ -366,6 +367,7 @@ exports.AppDataSource = new typeorm_1.DataSource({
366
367
  DocumentTypeModel_1.DocumentType,
367
368
  DocumentPermissionModel_1.DocumentPermission,
368
369
  DocumentAuditLogModel_1.DocumentAuditLog,
370
+ DocumentVersionModel_1.DocumentVersion,
369
371
  DocumentAccessModel_1.DocumentAccess,
370
372
  DepartmentDocumentOwnerModel_1.DepartmentDocumentOwner
371
373
  ],
package/dist/index.d.ts CHANGED
@@ -285,6 +285,7 @@ export * from './models/DocumentFolderModel';
285
285
  export * from './models/DocumentDriveModel';
286
286
  export * from './models/DocumentPermissionModel';
287
287
  export * from './models/DocumentAuditLogModel';
288
+ export * from './models/DocumentVersionModel';
288
289
  export * from './models/DocumentAccessModel';
289
290
  export * from './models/DepartmentDocumentOwnerModel';
290
291
  export * from './models/ResidentialUnitRentalRequestModel';
package/dist/index.js CHANGED
@@ -443,6 +443,7 @@ __exportStar(require("./models/DocumentFolderModel"), exports);
443
443
  __exportStar(require("./models/DocumentDriveModel"), exports);
444
444
  __exportStar(require("./models/DocumentPermissionModel"), exports);
445
445
  __exportStar(require("./models/DocumentAuditLogModel"), exports);
446
+ __exportStar(require("./models/DocumentVersionModel"), exports);
446
447
  __exportStar(require("./models/DocumentAccessModel"), exports);
447
448
  __exportStar(require("./models/DepartmentDocumentOwnerModel"), exports);
448
449
  // Residential Unit Rental Service
@@ -0,0 +1,17 @@
1
+ import { BaseModel } from './BaseModel';
2
+ import { Document } from './DocumentModel';
3
+ /**
4
+ * Historical file payload when a document is re-uploaded with the same file name
5
+ * in the same folder/drive placement. Points to the previous GridFS object.
6
+ */
7
+ export declare class DocumentVersion extends BaseModel {
8
+ document_id: number;
9
+ /** Version number of the document row at the time this snapshot was superseded */
10
+ version: number;
11
+ mongodb_file_id: string;
12
+ file_name: string;
13
+ file_size: number;
14
+ file_type?: string;
15
+ title_snapshot?: string;
16
+ document?: Document;
17
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DocumentVersion = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ const DocumentModel_1 = require("./DocumentModel");
16
+ /**
17
+ * Historical file payload when a document is re-uploaded with the same file name
18
+ * in the same folder/drive placement. Points to the previous GridFS object.
19
+ */
20
+ let DocumentVersion = class DocumentVersion extends BaseModel_1.BaseModel {
21
+ };
22
+ exports.DocumentVersion = DocumentVersion;
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
25
+ __metadata("design:type", Number)
26
+ ], DocumentVersion.prototype, "document_id", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
29
+ __metadata("design:type", Number)
30
+ ], DocumentVersion.prototype, "version", void 0);
31
+ __decorate([
32
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
33
+ __metadata("design:type", String)
34
+ ], DocumentVersion.prototype, "mongodb_file_id", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
37
+ __metadata("design:type", String)
38
+ ], DocumentVersion.prototype, "file_name", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ type: 'bigint', nullable: false }),
41
+ __metadata("design:type", Number)
42
+ ], DocumentVersion.prototype, "file_size", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
45
+ __metadata("design:type", String)
46
+ ], DocumentVersion.prototype, "file_type", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
49
+ __metadata("design:type", String)
50
+ ], DocumentVersion.prototype, "title_snapshot", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.ManyToOne)(() => DocumentModel_1.Document, { onDelete: 'CASCADE' }),
53
+ (0, typeorm_1.JoinColumn)({ name: 'document_id' }),
54
+ __metadata("design:type", DocumentModel_1.Document)
55
+ ], DocumentVersion.prototype, "document", void 0);
56
+ exports.DocumentVersion = DocumentVersion = __decorate([
57
+ (0, typeorm_1.Entity)({ name: 'document_versions' })
58
+ ], DocumentVersion);
@@ -21,7 +21,7 @@ export declare class ResidentialUnitRentalRequest extends BaseModel {
21
21
  extension_number: string;
22
22
  preferred_start_date: Date;
23
23
  family_size: number;
24
- duration_of_stay: string;
24
+ phone_number: string;
25
25
  location_of_unit: string;
26
26
  comment: string;
27
27
  status: string;
@@ -64,7 +64,7 @@ __decorate([
64
64
  __decorate([
65
65
  (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: false }),
66
66
  __metadata("design:type", String)
67
- ], ResidentialUnitRentalRequest.prototype, "duration_of_stay", void 0);
67
+ ], ResidentialUnitRentalRequest.prototype, "phone_number", void 0);
68
68
  __decorate([
69
69
  (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
70
70
  __metadata("design:type", String)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/civil-aviation-authority",
3
- "version": "2.3.159",
3
+ "version": "2.3.161",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -103,6 +103,7 @@ import { DocumentDrive } from './models/DocumentDriveModel';
103
103
  import { DocumentType } from './models/DocumentTypeModel';
104
104
  import { DocumentPermission } from './models/DocumentPermissionModel';
105
105
  import { DocumentAuditLog } from './models/DocumentAuditLogModel';
106
+ import { DocumentVersion } from './models/DocumentVersionModel';
106
107
  import { DocumentAccess } from './models/DocumentAccessModel';
107
108
  import { DepartmentDocumentOwner } from './models/DepartmentDocumentOwnerModel';
108
109
  import { TrainingWorkFlow } from './models/TrainingWorkflowModel';
@@ -365,6 +366,7 @@ export const AppDataSource = new DataSource({
365
366
  DocumentType,
366
367
  DocumentPermission,
367
368
  DocumentAuditLog,
369
+ DocumentVersion,
368
370
  DocumentAccess,
369
371
  DepartmentDocumentOwner
370
372
  ],
package/src/index.ts CHANGED
@@ -341,6 +341,7 @@ export * from './models/DocumentFolderModel';
341
341
  export * from './models/DocumentDriveModel';
342
342
  export * from './models/DocumentPermissionModel';
343
343
  export * from './models/DocumentAuditLogModel';
344
+ export * from './models/DocumentVersionModel';
344
345
  export * from './models/DocumentAccessModel';
345
346
  export * from './models/DepartmentDocumentOwnerModel';
346
347
 
@@ -0,0 +1,36 @@
1
+ import { Column, Entity, ManyToOne, JoinColumn } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+ import { Document } from './DocumentModel';
4
+
5
+ /**
6
+ * Historical file payload when a document is re-uploaded with the same file name
7
+ * in the same folder/drive placement. Points to the previous GridFS object.
8
+ */
9
+ @Entity({ name: 'document_versions' })
10
+ export class DocumentVersion extends BaseModel {
11
+ @Column({ type: 'integer', nullable: false })
12
+ document_id: number;
13
+
14
+ /** Version number of the document row at the time this snapshot was superseded */
15
+ @Column({ type: 'integer', nullable: false })
16
+ version: number;
17
+
18
+ @Column({ type: 'varchar', length: 255, nullable: false })
19
+ mongodb_file_id: string;
20
+
21
+ @Column({ type: 'varchar', length: 255, nullable: false })
22
+ file_name: string;
23
+
24
+ @Column({ type: 'bigint', nullable: false })
25
+ file_size: number;
26
+
27
+ @Column({ type: 'varchar', length: 100, nullable: true })
28
+ file_type?: string;
29
+
30
+ @Column({ type: 'varchar', length: 200, nullable: true })
31
+ title_snapshot?: string;
32
+
33
+ @ManyToOne(() => Document, { onDelete: 'CASCADE' })
34
+ @JoinColumn({ name: 'document_id' })
35
+ document?: Document;
36
+ }
@@ -104,7 +104,7 @@ export class ResidentialUnitRentalRequest extends BaseModel {
104
104
 
105
105
  @Column({ type: 'varchar', length: 50, nullable: false })
106
106
 
107
- duration_of_stay: string; // Months/Years
107
+ phone_number: string;
108
108
 
109
109
 
110
110