@platform-modules/civil-aviation-authority 2.3.67 → 2.3.69

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.
Files changed (39) hide show
  1. package/dist/data-source.js +11 -15
  2. package/dist/index.d.ts +0 -211
  3. package/dist/index.js +0 -319
  4. package/dist/models/DepartmentDocumentOwnerModel.d.ts +10 -0
  5. package/dist/models/DepartmentDocumentOwnerModel.js +44 -0
  6. package/dist/models/DocumentAuditLogModel.d.ts +12 -18
  7. package/dist/models/DocumentAuditLogModel.js +26 -34
  8. package/dist/models/DocumentFolderModel.d.ts +14 -0
  9. package/dist/models/DocumentFolderModel.js +60 -0
  10. package/dist/models/DocumentMetadataModel.d.ts +9 -12
  11. package/dist/models/DocumentMetadataModel.js +33 -22
  12. package/dist/models/DocumentModel.d.ts +25 -0
  13. package/dist/models/DocumentModel.js +96 -0
  14. package/dist/models/DocumentPermissionModel.d.ts +11 -0
  15. package/dist/models/DocumentPermissionModel.js +52 -0
  16. package/dist/models/DocumentTypeModel.d.ts +8 -0
  17. package/dist/models/DocumentTypeModel.js +37 -0
  18. package/dist/models/DocumentationDepartmentsModel.d.ts +5 -10
  19. package/dist/models/DocumentationDepartmentsModel.js +12 -31
  20. package/dist/models/FolderModel.d.ts +6 -9
  21. package/dist/models/FolderModel.js +18 -22
  22. package/dist/models/PermissionModel.d.ts +4 -7
  23. package/dist/models/PermissionModel.js +13 -22
  24. package/dist/models/UUIDBaseModel.d.ts +14 -0
  25. package/dist/models/UUIDBaseModel.js +66 -0
  26. package/package.json +1 -1
  27. package/src/data-source.ts +267 -271
  28. package/src/index.ts +0 -238
  29. package/src/models/DepartmentDocumentOwnerModel.ts +25 -0
  30. package/src/models/DepartmentsModel.ts +25 -25
  31. package/src/models/DocumentAuditLogModel.ts +38 -52
  32. package/src/models/DocumentFolderModel.ts +37 -0
  33. package/src/models/DocumentModel.ts +65 -0
  34. package/src/models/DocumentPermissionModel.ts +32 -0
  35. package/src/models/DocumentTypeModel.ts +19 -0
  36. package/src/models/DocumentMetadataModel.ts +0 -125
  37. package/src/models/DocumentationDepartmentsModel.ts +0 -55
  38. package/src/models/FolderModel.ts +0 -71
  39. package/src/models/PermissionModel.ts +0 -60
@@ -1,125 +0,0 @@
1
- import {
2
- Entity,
3
- PrimaryGeneratedColumn,
4
- Column,
5
- CreateDateColumn,
6
- UpdateDateColumn,
7
- Index,
8
- ManyToOne,
9
- JoinColumn,
10
- } from 'typeorm';
11
- import { Departments } from './DepartmentsModel';
12
-
13
- export enum DocumentType {
14
- POLICY = 'policy',
15
- PROCEDURE = 'procedure',
16
- MANUAL = 'manual',
17
- TEMPLATE = 'template',
18
- REPORT = 'report',
19
- }
20
-
21
- export enum DocumentStatus {
22
- ACTIVE = 'active',
23
- ARCHIVED = 'archived',
24
- DRAFT = 'draft',
25
- }
26
-
27
- export enum AccessLevel {
28
- GENERAL = 'general',
29
- RESTRICTED = 'restricted',
30
- }
31
-
32
- @Entity({ name: 'document_metadata' })
33
- export class DocumentMetadata {
34
- @PrimaryGeneratedColumn('uuid')
35
- id: string;
36
-
37
- @Column({ type: 'varchar', length: 500 })
38
- @Index()
39
- title: string;
40
-
41
- @Column({ type: 'text', nullable: true })
42
- description: string;
43
-
44
- @Column({ type: 'varchar', length: 255 })
45
- original_name: string;
46
-
47
- @Column({ type: 'varchar', length: 100 })
48
- mime_type: string;
49
-
50
- @Column({ type: 'bigint' })
51
- size: number;
52
-
53
- @Column({ type: 'varchar', length: 255, unique: true })
54
- mongodb_file_id: string; // GridFS file ID reference
55
-
56
- @Column({ type: 'enum', enum: DocumentType })
57
- @Index()
58
- document_type: DocumentType;
59
-
60
- @Column({ type: 'enum', enum: AccessLevel, default: AccessLevel.GENERAL })
61
- @Index()
62
- access_level: AccessLevel;
63
-
64
- @Column({ type: 'enum', enum: DocumentStatus, default: DocumentStatus.ACTIVE })
65
- @Index()
66
- status: DocumentStatus;
67
-
68
- @Column({ type: 'varchar', length: 50, default: '1.0.0' })
69
- version: string;
70
-
71
- @Column({ type: 'text', array: true, default: [] })
72
- tags: string[];
73
-
74
- @Column({ type: 'boolean', default: false })
75
- is_sensitive: boolean;
76
-
77
- @ManyToOne('Departments', { eager: true })
78
- @JoinColumn({ name: 'department_id' })
79
- department: Departments;
80
-
81
- @Column({ type: 'integer' })
82
- department_id: number; // References Departments.id (numeric from BaseModel)
83
-
84
- @Column({ type: 'uuid', nullable: true })
85
- folder_id: string | null;
86
-
87
- @Column({ type: 'varchar', length: 500, default: '/' })
88
- folder_path: string;
89
-
90
- @Column({ type: 'uuid' })
91
- uploaded_by: string; // User ID from User Service
92
-
93
- @Column({ type: 'varchar', length: 255, nullable: true })
94
- uploaded_by_name: string;
95
-
96
- @Column({ type: 'uuid', nullable: true })
97
- authorized_person: string; // Department authorized person user ID
98
-
99
- @Column({ type: 'text', array: true, default: [] })
100
- allowed_roles: string[]; // Role IDs for restricted access
101
-
102
- @Column({ type: 'text', array: true, default: [] })
103
- allowed_users: string[]; // User IDs for restricted access
104
-
105
- @Column({ type: 'int', default: 0 })
106
- download_count: number;
107
-
108
- @Column({ type: 'timestamp', nullable: true })
109
- last_accessed_at: Date;
110
-
111
- @Column({ type: 'jsonb', nullable: true })
112
- metadata: Record<string, any>;
113
-
114
- @Column({ type: 'uuid' })
115
- created_by: string;
116
-
117
- @Column({ type: 'uuid', nullable: true })
118
- updated_by: string;
119
-
120
- @CreateDateColumn({ type: 'timestamp' })
121
- created_at: Date;
122
-
123
- @UpdateDateColumn({ type: 'timestamp' })
124
- updated_at: Date;
125
- }
@@ -1,55 +0,0 @@
1
- import {
2
- Entity,
3
- PrimaryGeneratedColumn,
4
- Column,
5
- CreateDateColumn,
6
- UpdateDateColumn,
7
- ManyToOne,
8
- JoinColumn,
9
- Index,
10
- } from 'typeorm';
11
- import { Departments } from './DepartmentsModel';
12
-
13
- /**
14
- * Documentation Service specific department configuration
15
- * Links departments with authorized persons for document management
16
- */
17
- @Entity({ name: 'documentation_departments' })
18
- export class DocumentationDepartments {
19
- @PrimaryGeneratedColumn('uuid')
20
- id: string;
21
-
22
- @ManyToOne(() => Departments, { eager: true })
23
- @JoinColumn({ name: 'department_id' })
24
- department: Departments;
25
-
26
- @Column({ type: 'integer' })
27
- @Index()
28
- department_id: number; // References Departments.id (numeric from BaseModel)
29
-
30
- @Column({ type: 'varchar', length: 255 })
31
- @Index()
32
- authorized_person_id: string; // User ID of the authorized person
33
-
34
- @Column({ type: 'varchar', length: 255, nullable: true })
35
- authorized_person_name: string; // Name of authorized person
36
-
37
- @Column({ type: 'varchar', length: 255, nullable: true })
38
- authorized_person_email: string; // Email of authorized person
39
-
40
- @Column({ type: 'boolean', default: true })
41
- @Index()
42
- is_active: boolean;
43
-
44
- @Column({ type: 'uuid', nullable: true })
45
- created_by: string;
46
-
47
- @Column({ type: 'uuid', nullable: true })
48
- updated_by: string;
49
-
50
- @CreateDateColumn({ type: 'timestamp' })
51
- created_at: Date;
52
-
53
- @UpdateDateColumn({ type: 'timestamp' })
54
- updated_at: Date;
55
- }
@@ -1,71 +0,0 @@
1
- import {
2
- Entity,
3
- PrimaryGeneratedColumn,
4
- Column,
5
- CreateDateColumn,
6
- UpdateDateColumn,
7
- Index,
8
- ManyToOne,
9
- OneToMany,
10
- JoinColumn,
11
- } from 'typeorm';
12
- import { Departments } from './DepartmentsModel';
13
- // Note: DocumentMetadata import removed to avoid circular dependency
14
- // Use lazy loading or query builder when needed
15
-
16
- @Entity({ name: 'folders' })
17
- export class Folder {
18
- @PrimaryGeneratedColumn('uuid')
19
- id: string;
20
-
21
- @Column({ type: 'varchar', length: 255 })
22
- name: string;
23
-
24
- @Column({ type: 'varchar', length: 1000 })
25
- path: string; // Full path like /HR/policies/2024
26
-
27
- @Column({ type: 'varchar', length: 1000, nullable: true })
28
- parent_path: string;
29
-
30
- @ManyToOne('Departments', { eager: true })
31
- @JoinColumn({ name: 'department_id' })
32
- department: Departments;
33
-
34
- @Column({ type: 'integer' })
35
- department_id: number; // References Departments.id (numeric from BaseModel)
36
-
37
- @Column({ type: 'text', nullable: true })
38
- description: string;
39
-
40
- @Column({ type: 'enum', enum: ['general', 'restricted'], default: 'general' })
41
- @Index()
42
- access_level: 'general' | 'restricted';
43
-
44
- @Column({ type: 'text', array: true, default: [] })
45
- allowed_roles: string[]; // Role IDs for restricted folders
46
-
47
- @Column({ type: 'text', array: true, default: [] })
48
- allowed_users: string[]; // User IDs for restricted folders
49
-
50
- @Column({ type: 'uuid' })
51
- created_by: string;
52
-
53
- @Column({ type: 'varchar', length: 255, nullable: true })
54
- created_by_name: string;
55
-
56
- @Column({ type: 'uuid', nullable: true })
57
- updated_by: string;
58
-
59
- @Column({ type: 'boolean', default: true })
60
- @Index()
61
- is_active: boolean;
62
-
63
- @CreateDateColumn({ type: 'timestamp' })
64
- created_at: Date;
65
-
66
- @UpdateDateColumn({ type: 'timestamp' })
67
- updated_at: Date;
68
-
69
- // Note: OneToMany relationship removed to avoid circular dependency
70
- // Use query builder to get documents for a folder
71
- }
@@ -1,60 +0,0 @@
1
- import {
2
- Entity,
3
- PrimaryGeneratedColumn,
4
- Column,
5
- CreateDateColumn,
6
- UpdateDateColumn,
7
- ManyToMany,
8
- Index,
9
- JoinTable,
10
- } from 'typeorm';
11
- import { Role } from './role';
12
-
13
- export enum PermissionType {
14
- VIEW = 'view',
15
- UPLOAD = 'upload',
16
- UPDATE = 'update',
17
- DELETE = 'delete',
18
- PUBLISH = 'publish',
19
- }
20
-
21
- @Entity({ name: 'permissions' })
22
- export class Permission {
23
- @PrimaryGeneratedColumn('uuid')
24
- id: string;
25
-
26
- @Column({ type: 'varchar', length: 100, unique: true })
27
- name: string;
28
-
29
- @Column({ type: 'varchar', length: 50, unique: true })
30
- code: string; // view, upload, update, delete, publish
31
-
32
- @Column({ type: 'enum', enum: PermissionType })
33
- type: PermissionType;
34
-
35
- @Column({ type: 'text', nullable: true })
36
- description: string;
37
-
38
- @Column({ type: 'boolean', default: true })
39
- is_active: boolean;
40
-
41
- @ManyToMany(() => Role)
42
- @JoinTable({
43
- name: 'role_permissions',
44
- joinColumn: { name: 'permission_id', referencedColumnName: 'id' },
45
- inverseJoinColumn: { name: 'role_id', referencedColumnName: 'id' },
46
- })
47
- roles: Role[];
48
-
49
- @Column({ type: 'uuid' })
50
- created_by: string;
51
-
52
- @Column({ type: 'uuid', nullable: true })
53
- updated_by: string;
54
-
55
- @CreateDateColumn({ type: 'timestamp' })
56
- created_at: Date;
57
-
58
- @UpdateDateColumn({ type: 'timestamp' })
59
- updated_at: Date;
60
- }