@platform-modules/civil-aviation-authority 2.3.99 → 2.3.100

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/.env CHANGED
@@ -1,20 +1,14 @@
1
- DB_HOST=164.52.222.169
2
- DB_PORT=5432
3
- DB_USER=postgres_admin_user
4
- DB_PASS=pg_admin_user_pwd_caa_fa_$%^&OIukhjgcvbn
5
- DB_NAME=CAA
6
-
7
- # DB_HOST=216.48.187.46
1
+ # DB_HOST=164.52.222.169
8
2
  # DB_PORT=5432
9
- # DB_USER=adminuser
10
- # DB_PASS=postgres_caa_fm_qa_34567
11
- # DB_NAME=CAA_QA
12
-
3
+ # DB_USER=postgres_admin_user
4
+ # DB_PASS=pg_admin_user_pwd_caa_fa_$%^&OIukhjgcvbn
5
+ # DB_NAME=CAA
13
6
 
14
7
 
8
+ DB_HOST=localhost
9
+ DB_PORT=5432
10
+ DB_USER=postgres
11
+ DB_PASS=admin123
12
+ DB_NAME=CAA
15
13
 
16
- # DB_HOST=localhost
17
- # DB_PORT=5432
18
- # DB_USER=postgres
19
- # DB_PASS=stevejobs
20
- # DB_NAME=CAA
14
+ TYPEORM_DATABASE_SYNC=true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/civil-aviation-authority",
3
- "version": "2.3.99",
3
+ "version": "2.3.100",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -1,26 +1,26 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
-
4
- @Entity({ name: 'departments' })
5
- export class Departments extends BaseModel {
6
-
7
- @Column({ type: 'varchar', length: 64, nullable: false})
8
- department_name: string;
9
-
10
- @Column({ type: 'varchar', length: 64, nullable: false})
11
- department_code: string;
12
-
13
- @Column({ nullable: false })
14
- department_description: string;
15
-
16
- constructor(
17
- department_name: string,
18
- department_code: string,
19
- department_description: string,
20
- ) {
21
- super();
22
- this.department_name = department_name
23
- this.department_code = department_code
24
- this.department_description = department_description
25
- }
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'departments' })
5
+ export class Departments extends BaseModel {
6
+
7
+ @Column({ type: 'varchar', length: 64, nullable: false})
8
+ department_name: string;
9
+
10
+ @Column({ type: 'varchar', length: 64, nullable: false})
11
+ department_code: string;
12
+
13
+ @Column({ nullable: false })
14
+ department_description: string;
15
+
16
+ constructor(
17
+ department_name: string,
18
+ department_code: string,
19
+ department_description: string,
20
+ ) {
21
+ super();
22
+ this.department_name = department_name
23
+ this.department_code = department_code
24
+ this.department_description = department_description
25
+ }
26
26
  }
@@ -1,62 +1,62 @@
1
- import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
- import { ITHelpDeskRequests } from './ITHelpDeskModel';
4
- import { User } from './user';
5
-
6
- @Entity({ name: 'it_request_chat' })
7
- export class ITRequestChat extends BaseModel {
8
-
9
- @Column({ type: 'integer', nullable: false })
10
- request_id: number;
11
-
12
- @ManyToOne(() => ITHelpDeskRequests)
13
- @JoinColumn({ name: 'request_id' })
14
- request: ITHelpDeskRequests;
15
-
16
- @Column({ type: 'integer', nullable: true })
17
- service_id: number | null;
18
-
19
- @Column({ type: 'integer', nullable: true })
20
- sub_service_id: number | null;
21
-
22
- @Column({ type: 'integer', nullable: false })
23
- user_id: number;
24
-
25
- @ManyToOne(() => User)
26
- @JoinColumn({ name: 'user_id' })
27
- user: User;
28
-
29
- @Column({ type: 'integer', nullable: true })
30
- role_id: number | null;
31
-
32
- @Column({ type: 'text', nullable: false })
33
- message: string;
34
-
35
- @Column({ type: 'text', nullable: true })
36
- status: string | null;
37
-
38
- @Column({ type: 'boolean', default: false })
39
- is_internal: boolean;
40
-
41
- constructor(
42
- request_id: number,
43
- user_id: number,
44
- message: string,
45
- is_internal?: boolean,
46
- service_id?: number | null,
47
- sub_service_id?: number | null,
48
- role_id?: number | null,
49
- status?: string | null
50
- ) {
51
- super();
52
- this.request_id = request_id;
53
- this.service_id = service_id || null;
54
- this.sub_service_id = sub_service_id || null;
55
- this.user_id = user_id;
56
- this.role_id = role_id || null;
57
- this.message = message;
58
- this.status = status || null;
59
- this.is_internal = is_internal || false;
60
- }
61
- }
62
-
1
+ import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+ import { ITHelpDeskRequests } from './ITHelpDeskModel';
4
+ import { User } from './user';
5
+
6
+ @Entity({ name: 'it_request_chat' })
7
+ export class ITRequestChat extends BaseModel {
8
+
9
+ @Column({ type: 'integer', nullable: false })
10
+ request_id: number;
11
+
12
+ @ManyToOne(() => ITHelpDeskRequests)
13
+ @JoinColumn({ name: 'request_id' })
14
+ request: ITHelpDeskRequests;
15
+
16
+ @Column({ type: 'integer', nullable: true })
17
+ service_id: number | null;
18
+
19
+ @Column({ type: 'integer', nullable: true })
20
+ sub_service_id: number | null;
21
+
22
+ @Column({ type: 'integer', nullable: false })
23
+ user_id: number;
24
+
25
+ @ManyToOne(() => User)
26
+ @JoinColumn({ name: 'user_id' })
27
+ user: User;
28
+
29
+ @Column({ type: 'integer', nullable: true })
30
+ role_id: number | null;
31
+
32
+ @Column({ type: 'text', nullable: false })
33
+ message: string;
34
+
35
+ @Column({ type: 'text', nullable: true })
36
+ status: string | null;
37
+
38
+ @Column({ type: 'boolean', default: false })
39
+ is_internal: boolean;
40
+
41
+ constructor(
42
+ request_id: number,
43
+ user_id: number,
44
+ message: string,
45
+ is_internal?: boolean,
46
+ service_id?: number | null,
47
+ sub_service_id?: number | null,
48
+ role_id?: number | null,
49
+ status?: string | null
50
+ ) {
51
+ super();
52
+ this.request_id = request_id;
53
+ this.service_id = service_id || null;
54
+ this.sub_service_id = sub_service_id || null;
55
+ this.user_id = user_id;
56
+ this.role_id = role_id || null;
57
+ this.message = message;
58
+ this.status = status || null;
59
+ this.is_internal = is_internal || false;
60
+ }
61
+ }
62
+
@@ -1,85 +1,85 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
-
4
-
5
- export enum ApprovalStatus {
6
- PENDING = "Pending",
7
- APPROVED = "Approved",
8
- REJECTED = "Rejected",
9
- ASSIGNED = "Assigned",
10
- REASSIGNED = "Reassigned"
11
-
12
- }
13
-
14
- @Entity({ name: 'it_approvals' })
15
- export class ItApprovalDetails extends BaseModel {
16
- @Column({ type: 'integer', nullable: false })
17
- request_id: number;
18
-
19
- @Column({ type: 'integer', nullable: true })
20
- service_id: number | null;
21
-
22
- @Column({ type: 'integer', nullable: true })
23
- sub_service_id: number | null;
24
-
25
- @Column({ type: 'integer', nullable: false })
26
- level: number;
27
-
28
- @Column({ type: 'integer', nullable: true })
29
- approver_user_id: number | null;
30
-
31
- @Column({ type: 'integer', nullable: true })
32
- delegation_user_id: number | null;
33
-
34
- @Column({ type: 'integer', nullable: false })
35
- approver_role_id: number | null;
36
-
37
- @Column({ type: 'integer', nullable: true })
38
- department_id: number | null;
39
-
40
- @Column({ type: 'integer', nullable: true })
41
- section_id: number | null;
42
-
43
- @Column({ type: 'integer', nullable: true })
44
- approved_by: number | null;
45
-
46
- @Column({ type: 'varchar', length: 255, nullable: false })
47
- comment: string;
48
-
49
- @Column({ type: 'enum', enum: ApprovalStatus,default: ApprovalStatus.PENDING, nullable: false })
50
- approval_status: ApprovalStatus;
51
-
52
- @Column({ type: 'boolean', default: true, nullable: false })
53
- is_allowed: boolean;
54
-
55
- constructor(
56
- request_id: number,
57
- approver_user_id: number | null,
58
- approver_role_id: number | null,
59
- comment: string,
60
- approval_status: ApprovalStatus,
61
- level: number,
62
- department_id?: number | null,
63
- section_id?: number | null,
64
- approved_by?: number | null,
65
- service_id?: number | null,
66
- sub_service_id?: number | null,
67
- delegation_user_id?: number | null,
68
- is_allowed?: boolean
69
- ) {
70
- super();
71
- this.request_id = request_id;
72
- this.approver_user_id = approver_user_id;
73
- this.approver_role_id = approver_role_id;
74
- this.comment = comment;
75
- this.approval_status = approval_status;
76
- this.level = level;
77
- this.department_id = department_id || null;
78
- this.section_id = section_id || null;
79
- this.approved_by = approved_by || null;
80
- this.service_id = service_id ?? null;
81
- this.sub_service_id = sub_service_id ?? null;
82
- this.delegation_user_id = delegation_user_id || null;
83
- this.is_allowed = is_allowed ?? true;
84
- }
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+
5
+ export enum ApprovalStatus {
6
+ PENDING = "Pending",
7
+ APPROVED = "Approved",
8
+ REJECTED = "Rejected",
9
+ ASSIGNED = "Assigned",
10
+ REASSIGNED = "Reassigned"
11
+
12
+ }
13
+
14
+ @Entity({ name: 'it_approvals' })
15
+ export class ItApprovalDetails extends BaseModel {
16
+ @Column({ type: 'integer', nullable: false })
17
+ request_id: number;
18
+
19
+ @Column({ type: 'integer', nullable: true })
20
+ service_id: number | null;
21
+
22
+ @Column({ type: 'integer', nullable: true })
23
+ sub_service_id: number | null;
24
+
25
+ @Column({ type: 'integer', nullable: false })
26
+ level: number;
27
+
28
+ @Column({ type: 'integer', nullable: true })
29
+ approver_user_id: number | null;
30
+
31
+ @Column({ type: 'integer', nullable: true })
32
+ delegation_user_id: number | null;
33
+
34
+ @Column({ type: 'integer', nullable: false })
35
+ approver_role_id: number | null;
36
+
37
+ @Column({ type: 'integer', nullable: true })
38
+ department_id: number | null;
39
+
40
+ @Column({ type: 'integer', nullable: true })
41
+ section_id: number | null;
42
+
43
+ @Column({ type: 'integer', nullable: true })
44
+ approved_by: number | null;
45
+
46
+ @Column({ type: 'varchar', length: 255, nullable: false })
47
+ comment: string;
48
+
49
+ @Column({ type: 'enum', enum: ApprovalStatus,default: ApprovalStatus.PENDING, nullable: false })
50
+ approval_status: ApprovalStatus;
51
+
52
+ @Column({ type: 'boolean', default: true, nullable: false })
53
+ is_allowed: boolean;
54
+
55
+ constructor(
56
+ request_id: number,
57
+ approver_user_id: number | null,
58
+ approver_role_id: number | null,
59
+ comment: string,
60
+ approval_status: ApprovalStatus,
61
+ level: number,
62
+ department_id?: number | null,
63
+ section_id?: number | null,
64
+ approved_by?: number | null,
65
+ service_id?: number | null,
66
+ sub_service_id?: number | null,
67
+ delegation_user_id?: number | null,
68
+ is_allowed?: boolean
69
+ ) {
70
+ super();
71
+ this.request_id = request_id;
72
+ this.approver_user_id = approver_user_id;
73
+ this.approver_role_id = approver_role_id;
74
+ this.comment = comment;
75
+ this.approval_status = approval_status;
76
+ this.level = level;
77
+ this.department_id = department_id || null;
78
+ this.section_id = section_id || null;
79
+ this.approved_by = approved_by || null;
80
+ this.service_id = service_id ?? null;
81
+ this.sub_service_id = sub_service_id ?? null;
82
+ this.delegation_user_id = delegation_user_id || null;
83
+ this.is_allowed = is_allowed ?? true;
84
+ }
85
85
  }
@@ -1,56 +1,56 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
-
4
- export enum workFlowStatus {
5
- COMPLETED = "Completed",
6
- NOT_YET_STARTED = "Not Yet Started",
7
- PENDING = "Pending"
8
- }
9
-
10
- //This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
11
- @Entity({ name: 'it_work_flows' })
12
- export class ItWorkFlow extends BaseModel {
13
- @Column({ type: 'int', nullable: false })
14
- request_id: number;
15
-
16
- @Column({ type: 'int', nullable: true })
17
- service_id: number | null;
18
-
19
- @Column({ type: 'int', nullable: true })
20
- sub_service_id: number | null;
21
-
22
- @Column({ type: 'int', nullable: true })
23
- order: number | null;
24
-
25
- @Column({ type: 'varchar', length: 255, nullable: false })
26
- content: string;
27
-
28
- @Column({ type: 'enum', enum: workFlowStatus, default: workFlowStatus.NOT_YET_STARTED, nullable: false })
29
- status: workFlowStatus;
30
-
31
- @Column({ type: 'integer', nullable: true })
32
- user_id: number | null;
33
-
34
- @Column({ type: 'integer', nullable: true })
35
- role_id: number | null;
36
-
37
- @Column({ type: 'integer', nullable: true })
38
- department_id: number | null;
39
-
40
- @Column({ type: 'integer', nullable: true })
41
- section_id: number | null;
42
-
43
- constructor(request_id: number, content: string, status: workFlowStatus, order?: number, service_id?: number | null, sub_service_id?: number | null, user_id?: number | null, role_id?: number | null, department_id?: number | null, section_id?: number | null) {
44
- super();
45
- this.request_id = request_id;
46
- this.content = content;
47
- this.status = status;
48
- this.order = order || null;
49
- this.service_id = service_id ?? null;
50
- this.sub_service_id = sub_service_id ?? null;
51
- this.user_id = user_id || null;
52
- this.role_id = role_id || null;
53
- this.department_id = department_id || null;
54
- this.section_id = section_id || null;
55
- }
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum workFlowStatus {
5
+ COMPLETED = "Completed",
6
+ NOT_YET_STARTED = "Not Yet Started",
7
+ PENDING = "Pending"
8
+ }
9
+
10
+ //This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
11
+ @Entity({ name: 'it_work_flows' })
12
+ export class ItWorkFlow extends BaseModel {
13
+ @Column({ type: 'int', nullable: false })
14
+ request_id: number;
15
+
16
+ @Column({ type: 'int', nullable: true })
17
+ service_id: number | null;
18
+
19
+ @Column({ type: 'int', nullable: true })
20
+ sub_service_id: number | null;
21
+
22
+ @Column({ type: 'int', nullable: true })
23
+ order: number | null;
24
+
25
+ @Column({ type: 'varchar', length: 255, nullable: false })
26
+ content: string;
27
+
28
+ @Column({ type: 'enum', enum: workFlowStatus, default: workFlowStatus.NOT_YET_STARTED, nullable: false })
29
+ status: workFlowStatus;
30
+
31
+ @Column({ type: 'integer', nullable: true })
32
+ user_id: number | null;
33
+
34
+ @Column({ type: 'integer', nullable: true })
35
+ role_id: number | null;
36
+
37
+ @Column({ type: 'integer', nullable: true })
38
+ department_id: number | null;
39
+
40
+ @Column({ type: 'integer', nullable: true })
41
+ section_id: number | null;
42
+
43
+ constructor(request_id: number, content: string, status: workFlowStatus, order?: number, service_id?: number | null, sub_service_id?: number | null, user_id?: number | null, role_id?: number | null, department_id?: number | null, section_id?: number | null) {
44
+ super();
45
+ this.request_id = request_id;
46
+ this.content = content;
47
+ this.status = status;
48
+ this.order = order || null;
49
+ this.service_id = service_id ?? null;
50
+ this.sub_service_id = sub_service_id ?? null;
51
+ this.user_id = user_id || null;
52
+ this.role_id = role_id || null;
53
+ this.department_id = department_id || null;
54
+ this.section_id = section_id || null;
55
+ }
56
56
  }
@@ -1,36 +1,36 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from "./BaseModel";
3
-
4
-
5
- @Entity({ name: "mission_travel_passport_expiry_notification_configs" })
6
- export class MissionTravelPassportExpiryNotificationConfig extends BaseModel {
7
- @Column({ type: "integer", nullable: false })
8
- department_id: number;
9
-
10
- @Column({ type: "integer", nullable: true })
11
- section_id: number | null;
12
-
13
- @Column({ type: "varchar", length: 255, nullable: true })
14
- frequency: string | null;
15
-
16
- @Column({ type: "integer", nullable: true })
17
- repeat_interval_days: number | null; // Repeating after every N days (default 10)
18
-
19
- @Column({ type: "boolean", nullable: false, default: true })
20
- is_active: boolean;
21
-
22
- constructor(
23
- department_id: number,
24
- section_id: number | null = null,
25
- frequency: string | null = null,
26
- repeat_interval_days: number = 10,
27
- is_active: boolean = true
28
- ) {
29
- super();
30
- this.department_id = department_id;
31
- this.section_id = section_id;
32
- this.frequency = frequency;
33
- this.repeat_interval_days = repeat_interval_days;
34
- this.is_active = is_active;
35
- }
36
- }
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+
4
+
5
+ @Entity({ name: "mission_travel_passport_expiry_notification_configs" })
6
+ export class MissionTravelPassportExpiryNotificationConfig extends BaseModel {
7
+ @Column({ type: "integer", nullable: false })
8
+ department_id: number;
9
+
10
+ @Column({ type: "integer", nullable: true })
11
+ section_id: number | null;
12
+
13
+ @Column({ type: "varchar", length: 255, nullable: true })
14
+ frequency: string | null;
15
+
16
+ @Column({ type: "integer", nullable: true })
17
+ repeat_interval_days: number | null; // Repeating after every N days (default 10)
18
+
19
+ @Column({ type: "boolean", nullable: false, default: true })
20
+ is_active: boolean;
21
+
22
+ constructor(
23
+ department_id: number,
24
+ section_id: number | null = null,
25
+ frequency: string | null = null,
26
+ repeat_interval_days: number = 10,
27
+ is_active: boolean = true
28
+ ) {
29
+ super();
30
+ this.department_id = department_id;
31
+ this.section_id = section_id;
32
+ this.frequency = frequency;
33
+ this.repeat_interval_days = repeat_interval_days;
34
+ this.is_active = is_active;
35
+ }
36
+ }
@@ -1,55 +1,55 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from "./BaseModel";
3
-
4
- export enum ServicesNotificationTriggerType {
5
- FINAL_APPROVAL = "final_approval",
6
- EVERY_APPROVAL = "every_approval"
7
- }
8
-
9
- @Entity({ name: "services_notification_configs" })
10
- export class ServicesNotificationConfigs extends BaseModel {
11
- @Column({ type: "integer", nullable: false })
12
- service_id: number;
13
-
14
- @Column({ type: "integer", nullable: false })
15
- sub_service_id: number;
16
-
17
- @Column({ type: "integer", nullable: false })
18
- department_id: number;
19
-
20
- @Column({ type: "integer", nullable: true })
21
- section_id: number | null;
22
-
23
- @Column({ type: "integer", nullable: true })
24
- role_id: number | null;
25
-
26
- @Column({
27
- type: "enum",
28
- enum: ServicesNotificationTriggerType,
29
- nullable: false,
30
- default: ServicesNotificationTriggerType.FINAL_APPROVAL
31
- })
32
- trigger: ServicesNotificationTriggerType;
33
-
34
- @Column({ type: "boolean", nullable: false, default: true })
35
- is_active: boolean;
36
-
37
- constructor(
38
- service_id: number,
39
- sub_service_id: number,
40
- department_id: number,
41
- section_id: number | null = null,
42
- role_id: number | null = null,
43
- trigger: ServicesNotificationTriggerType = ServicesNotificationTriggerType.FINAL_APPROVAL,
44
- is_active: boolean = true
45
- ) {
46
- super();
47
- this.service_id = service_id;
48
- this.sub_service_id = sub_service_id;
49
- this.department_id = department_id;
50
- this.section_id = section_id;
51
- this.role_id = role_id;
52
- this.trigger = trigger;
53
- this.is_active = is_active;
54
- }
55
- }
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+
4
+ export enum ServicesNotificationTriggerType {
5
+ FINAL_APPROVAL = "final_approval",
6
+ EVERY_APPROVAL = "every_approval"
7
+ }
8
+
9
+ @Entity({ name: "services_notification_configs" })
10
+ export class ServicesNotificationConfigs extends BaseModel {
11
+ @Column({ type: "integer", nullable: false })
12
+ service_id: number;
13
+
14
+ @Column({ type: "integer", nullable: false })
15
+ sub_service_id: number;
16
+
17
+ @Column({ type: "integer", nullable: false })
18
+ department_id: number;
19
+
20
+ @Column({ type: "integer", nullable: true })
21
+ section_id: number | null;
22
+
23
+ @Column({ type: "integer", nullable: true })
24
+ role_id: number | null;
25
+
26
+ @Column({
27
+ type: "enum",
28
+ enum: ServicesNotificationTriggerType,
29
+ nullable: false,
30
+ default: ServicesNotificationTriggerType.FINAL_APPROVAL
31
+ })
32
+ trigger: ServicesNotificationTriggerType;
33
+
34
+ @Column({ type: "boolean", nullable: false, default: true })
35
+ is_active: boolean;
36
+
37
+ constructor(
38
+ service_id: number,
39
+ sub_service_id: number,
40
+ department_id: number,
41
+ section_id: number | null = null,
42
+ role_id: number | null = null,
43
+ trigger: ServicesNotificationTriggerType = ServicesNotificationTriggerType.FINAL_APPROVAL,
44
+ is_active: boolean = true
45
+ ) {
46
+ super();
47
+ this.service_id = service_id;
48
+ this.sub_service_id = sub_service_id;
49
+ this.department_id = department_id;
50
+ this.section_id = section_id;
51
+ this.role_id = role_id;
52
+ this.trigger = trigger;
53
+ this.is_active = is_active;
54
+ }
55
+ }
@@ -1,30 +1,30 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from "./BaseModel";
3
-
4
- export enum NotificationFrequency {
5
- YEARLY = "yearly",
6
- SIX_MONTHS_BEFORE = "6_months_before"
7
- }
8
-
9
- @Entity({ name: "training_room_notification_configs" })
10
- export class TrainingRoomNotificationConfig extends BaseModel {
11
- @Column({ type: "integer", nullable: false })
12
- department_id: number;
13
-
14
- @Column({ type: "integer", nullable: true })
15
- section_id: number | null;
16
-
17
- @Column({ type: "boolean", nullable: false, default: true })
18
- is_active: boolean;
19
-
20
- constructor(
21
- department_id: number,
22
- section_id: number | null = null,
23
- is_active: boolean = true
24
- ) {
25
- super();
26
- this.department_id = department_id;
27
- this.section_id = section_id;
28
- this.is_active = is_active;
29
- }
30
- }
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+
4
+ export enum NotificationFrequency {
5
+ YEARLY = "yearly",
6
+ SIX_MONTHS_BEFORE = "6_months_before"
7
+ }
8
+
9
+ @Entity({ name: "training_room_notification_configs" })
10
+ export class TrainingRoomNotificationConfig extends BaseModel {
11
+ @Column({ type: "integer", nullable: false })
12
+ department_id: number;
13
+
14
+ @Column({ type: "integer", nullable: true })
15
+ section_id: number | null;
16
+
17
+ @Column({ type: "boolean", nullable: false, default: true })
18
+ is_active: boolean;
19
+
20
+ constructor(
21
+ department_id: number,
22
+ section_id: number | null = null,
23
+ is_active: boolean = true
24
+ ) {
25
+ super();
26
+ this.department_id = department_id;
27
+ this.section_id = section_id;
28
+ this.is_active = is_active;
29
+ }
30
+ }
@@ -1,45 +0,0 @@
1
- import { Departments } from './DepartmentsModel';
2
- import { UUIDBaseModel } from './UUIDBaseModel';
3
- export declare enum DocumentType {
4
- POLICY = "policy",
5
- PROCEDURE = "procedure",
6
- MANUAL = "manual",
7
- TEMPLATE = "template",
8
- REPORT = "report"
9
- }
10
- export declare enum DocumentStatus {
11
- ACTIVE = "active",
12
- ARCHIVED = "archived",
13
- DRAFT = "draft"
14
- }
15
- export declare enum AccessLevel {
16
- GENERAL = "general",
17
- RESTRICTED = "restricted"
18
- }
19
- export declare class DocumentMetadata extends UUIDBaseModel {
20
- title: string;
21
- description?: string;
22
- original_name: string;
23
- mime_type: string;
24
- size: number;
25
- mongodb_file_id: string;
26
- document_type: DocumentType;
27
- access_level: AccessLevel;
28
- status: DocumentStatus;
29
- version: string;
30
- tags: string[];
31
- is_sensitive: boolean;
32
- department: Departments;
33
- department_id: number;
34
- folder_id?: string | null;
35
- folder_path: string;
36
- uploaded_by: string;
37
- uploaded_by_name?: string;
38
- authorized_person?: string;
39
- allowed_roles: string[];
40
- allowed_users: string[];
41
- download_count: number;
42
- last_accessed_at?: Date;
43
- metadata?: Record<string, any>;
44
- constructor(title: string, original_name: string, mime_type: string, size: number, mongodb_file_id: string, document_type: DocumentType, department_id: number, uploaded_by: string, access_level?: AccessLevel, status?: DocumentStatus, version?: string, folder_path?: string, created_by?: string, description?: string, folder_id?: string | null, uploaded_by_name?: string, authorized_person?: string, tags?: string[], allowed_roles?: string[], allowed_users?: string[], is_sensitive?: boolean, download_count?: number, last_accessed_at?: Date, metadata?: Record<string, any>);
45
- }
@@ -1,171 +0,0 @@
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.DocumentMetadata = exports.AccessLevel = exports.DocumentStatus = exports.DocumentType = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const DepartmentsModel_1 = require("./DepartmentsModel");
15
- const UUIDBaseModel_1 = require("./UUIDBaseModel");
16
- var DocumentType;
17
- (function (DocumentType) {
18
- DocumentType["POLICY"] = "policy";
19
- DocumentType["PROCEDURE"] = "procedure";
20
- DocumentType["MANUAL"] = "manual";
21
- DocumentType["TEMPLATE"] = "template";
22
- DocumentType["REPORT"] = "report";
23
- })(DocumentType || (exports.DocumentType = DocumentType = {}));
24
- var DocumentStatus;
25
- (function (DocumentStatus) {
26
- DocumentStatus["ACTIVE"] = "active";
27
- DocumentStatus["ARCHIVED"] = "archived";
28
- DocumentStatus["DRAFT"] = "draft";
29
- })(DocumentStatus || (exports.DocumentStatus = DocumentStatus = {}));
30
- var AccessLevel;
31
- (function (AccessLevel) {
32
- AccessLevel["GENERAL"] = "general";
33
- AccessLevel["RESTRICTED"] = "restricted";
34
- })(AccessLevel || (exports.AccessLevel = AccessLevel = {}));
35
- let DocumentMetadata = class DocumentMetadata extends UUIDBaseModel_1.UUIDBaseModel {
36
- constructor(title, original_name, mime_type, size, mongodb_file_id, document_type, department_id, uploaded_by, access_level = AccessLevel.GENERAL, status = DocumentStatus.ACTIVE, version = '1.0.0', folder_path = '/', created_by, description, folder_id, uploaded_by_name, authorized_person, tags, allowed_roles, allowed_users, is_sensitive = false, download_count = 0, last_accessed_at, metadata) {
37
- super();
38
- this.title = title;
39
- this.original_name = original_name;
40
- this.mime_type = mime_type;
41
- this.size = size;
42
- this.mongodb_file_id = mongodb_file_id;
43
- this.document_type = document_type;
44
- this.department_id = department_id;
45
- this.uploaded_by = uploaded_by;
46
- this.access_level = access_level;
47
- this.status = status;
48
- this.version = version;
49
- this.folder_path = folder_path;
50
- this.description = description;
51
- this.folder_id = folder_id;
52
- this.uploaded_by_name = uploaded_by_name;
53
- this.authorized_person = authorized_person;
54
- this.tags = tags || [];
55
- this.allowed_roles = allowed_roles || [];
56
- this.allowed_users = allowed_users || [];
57
- this.is_sensitive = is_sensitive;
58
- this.download_count = download_count;
59
- this.last_accessed_at = last_accessed_at;
60
- this.metadata = metadata;
61
- if (created_by) {
62
- this.created_by = created_by;
63
- }
64
- }
65
- };
66
- exports.DocumentMetadata = DocumentMetadata;
67
- __decorate([
68
- (0, typeorm_1.Column)({ type: 'varchar', length: 500 }),
69
- (0, typeorm_1.Index)(),
70
- __metadata("design:type", String)
71
- ], DocumentMetadata.prototype, "title", void 0);
72
- __decorate([
73
- (0, typeorm_1.Column)({ type: 'text', nullable: true }),
74
- __metadata("design:type", String)
75
- ], DocumentMetadata.prototype, "description", void 0);
76
- __decorate([
77
- (0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
78
- __metadata("design:type", String)
79
- ], DocumentMetadata.prototype, "original_name", void 0);
80
- __decorate([
81
- (0, typeorm_1.Column)({ type: 'varchar', length: 100 }),
82
- __metadata("design:type", String)
83
- ], DocumentMetadata.prototype, "mime_type", void 0);
84
- __decorate([
85
- (0, typeorm_1.Column)({ type: 'bigint' }),
86
- __metadata("design:type", Number)
87
- ], DocumentMetadata.prototype, "size", void 0);
88
- __decorate([
89
- (0, typeorm_1.Column)({ type: 'varchar', length: 255, unique: true }),
90
- __metadata("design:type", String)
91
- ], DocumentMetadata.prototype, "mongodb_file_id", void 0);
92
- __decorate([
93
- (0, typeorm_1.Column)({ type: 'enum', enum: DocumentType }),
94
- (0, typeorm_1.Index)(),
95
- __metadata("design:type", String)
96
- ], DocumentMetadata.prototype, "document_type", void 0);
97
- __decorate([
98
- (0, typeorm_1.Column)({ type: 'enum', enum: AccessLevel, default: AccessLevel.GENERAL }),
99
- (0, typeorm_1.Index)(),
100
- __metadata("design:type", String)
101
- ], DocumentMetadata.prototype, "access_level", void 0);
102
- __decorate([
103
- (0, typeorm_1.Column)({ type: 'enum', enum: DocumentStatus, default: DocumentStatus.ACTIVE }),
104
- (0, typeorm_1.Index)(),
105
- __metadata("design:type", String)
106
- ], DocumentMetadata.prototype, "status", void 0);
107
- __decorate([
108
- (0, typeorm_1.Column)({ type: 'varchar', length: 50, default: '1.0.0' }),
109
- __metadata("design:type", String)
110
- ], DocumentMetadata.prototype, "version", void 0);
111
- __decorate([
112
- (0, typeorm_1.Column)({ type: 'text', array: true, default: [] }),
113
- __metadata("design:type", Array)
114
- ], DocumentMetadata.prototype, "tags", void 0);
115
- __decorate([
116
- (0, typeorm_1.Column)({ type: 'boolean', default: false }),
117
- __metadata("design:type", Boolean)
118
- ], DocumentMetadata.prototype, "is_sensitive", void 0);
119
- __decorate([
120
- (0, typeorm_1.ManyToOne)('Departments', { eager: true }),
121
- (0, typeorm_1.JoinColumn)({ name: 'department_id' }),
122
- __metadata("design:type", DepartmentsModel_1.Departments)
123
- ], DocumentMetadata.prototype, "department", void 0);
124
- __decorate([
125
- (0, typeorm_1.Column)({ type: 'integer' }),
126
- __metadata("design:type", Number)
127
- ], DocumentMetadata.prototype, "department_id", void 0);
128
- __decorate([
129
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
130
- __metadata("design:type", Object)
131
- ], DocumentMetadata.prototype, "folder_id", void 0);
132
- __decorate([
133
- (0, typeorm_1.Column)({ type: 'varchar', length: 500, default: '/' }),
134
- __metadata("design:type", String)
135
- ], DocumentMetadata.prototype, "folder_path", void 0);
136
- __decorate([
137
- (0, typeorm_1.Column)({ type: 'uuid' }),
138
- __metadata("design:type", String)
139
- ], DocumentMetadata.prototype, "uploaded_by", void 0);
140
- __decorate([
141
- (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
142
- __metadata("design:type", String)
143
- ], DocumentMetadata.prototype, "uploaded_by_name", void 0);
144
- __decorate([
145
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
146
- __metadata("design:type", String)
147
- ], DocumentMetadata.prototype, "authorized_person", void 0);
148
- __decorate([
149
- (0, typeorm_1.Column)({ type: 'text', array: true, default: [] }),
150
- __metadata("design:type", Array)
151
- ], DocumentMetadata.prototype, "allowed_roles", void 0);
152
- __decorate([
153
- (0, typeorm_1.Column)({ type: 'text', array: true, default: [] }),
154
- __metadata("design:type", Array)
155
- ], DocumentMetadata.prototype, "allowed_users", void 0);
156
- __decorate([
157
- (0, typeorm_1.Column)({ type: 'int', default: 0 }),
158
- __metadata("design:type", Number)
159
- ], DocumentMetadata.prototype, "download_count", void 0);
160
- __decorate([
161
- (0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
162
- __metadata("design:type", Date)
163
- ], DocumentMetadata.prototype, "last_accessed_at", void 0);
164
- __decorate([
165
- (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
166
- __metadata("design:type", Object)
167
- ], DocumentMetadata.prototype, "metadata", void 0);
168
- exports.DocumentMetadata = DocumentMetadata = __decorate([
169
- (0, typeorm_1.Entity)({ name: 'document_metadata' }),
170
- __metadata("design:paramtypes", [String, String, String, Number, String, String, Number, String, String, String, String, String, String, String, Object, String, String, Array, Array, Array, Boolean, Number, Date, Object])
171
- ], DocumentMetadata);
@@ -1,13 +0,0 @@
1
- import { BaseModel } from './BaseModel';
2
- /**
3
- * Documentation Service specific department configuration
4
- * Links departments with authorized persons for document management
5
- */
6
- export declare class DocumentationDepartments extends BaseModel {
7
- department_id: number;
8
- authorized_person_id: string;
9
- authorized_person_name?: string;
10
- authorized_person_email?: string;
11
- is_active: boolean;
12
- constructor(department_id: number, authorized_person_id: string, authorized_person_name: string, authorized_person_email: string, is_active?: boolean);
13
- }
@@ -1,53 +0,0 @@
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.DocumentationDepartments = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const BaseModel_1 = require("./BaseModel");
15
- /**
16
- * Documentation Service specific department configuration
17
- * Links departments with authorized persons for document management
18
- */
19
- let DocumentationDepartments = class DocumentationDepartments extends BaseModel_1.BaseModel {
20
- constructor(department_id, authorized_person_id, authorized_person_name, authorized_person_email, is_active = true) {
21
- super();
22
- this.department_id = department_id;
23
- this.authorized_person_id = authorized_person_id;
24
- this.authorized_person_name = authorized_person_name;
25
- this.authorized_person_email = authorized_person_email;
26
- this.is_active = is_active;
27
- }
28
- };
29
- exports.DocumentationDepartments = DocumentationDepartments;
30
- __decorate([
31
- (0, typeorm_1.Column)({ type: 'integer' }),
32
- __metadata("design:type", Number)
33
- ], DocumentationDepartments.prototype, "department_id", void 0);
34
- __decorate([
35
- (0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
36
- __metadata("design:type", String)
37
- ], DocumentationDepartments.prototype, "authorized_person_id", void 0);
38
- __decorate([
39
- (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
40
- __metadata("design:type", String)
41
- ], DocumentationDepartments.prototype, "authorized_person_name", void 0);
42
- __decorate([
43
- (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
44
- __metadata("design:type", String)
45
- ], DocumentationDepartments.prototype, "authorized_person_email", void 0);
46
- __decorate([
47
- (0, typeorm_1.Column)({ type: 'boolean', default: true }),
48
- __metadata("design:type", Boolean)
49
- ], DocumentationDepartments.prototype, "is_active", void 0);
50
- exports.DocumentationDepartments = DocumentationDepartments = __decorate([
51
- (0, typeorm_1.Entity)({ name: 'documentation_departments' }),
52
- __metadata("design:paramtypes", [Number, String, String, String, Boolean])
53
- ], DocumentationDepartments);
@@ -1,16 +0,0 @@
1
- import { Departments } from './DepartmentsModel';
2
- import { UUIDBaseModel } from './UUIDBaseModel';
3
- export declare class Folder extends UUIDBaseModel {
4
- name: string;
5
- path: string;
6
- parent_path?: string;
7
- department: Departments;
8
- department_id: number;
9
- description?: string;
10
- access_level: 'general' | 'restricted';
11
- allowed_roles: string[];
12
- allowed_users: string[];
13
- created_by_name?: string;
14
- is_active: boolean;
15
- constructor(name: string, path: string, department_id: number, created_by: string, access_level?: 'general' | 'restricted', parent_path?: string, description?: string, created_by_name?: string, allowed_roles?: string[], allowed_users?: string[], is_active?: boolean);
16
- }
@@ -1,85 +0,0 @@
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.Folder = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const DepartmentsModel_1 = require("./DepartmentsModel");
15
- const UUIDBaseModel_1 = require("./UUIDBaseModel");
16
- // Note: DocumentMetadata import removed to avoid circular dependency
17
- // Use lazy loading or query builder when needed
18
- let Folder = class Folder extends UUIDBaseModel_1.UUIDBaseModel {
19
- constructor(name, path, department_id, created_by, access_level = 'general', parent_path, description, created_by_name, allowed_roles, allowed_users, is_active = true) {
20
- super();
21
- this.name = name;
22
- this.path = path;
23
- this.department_id = department_id;
24
- this.created_by = created_by;
25
- this.access_level = access_level;
26
- this.parent_path = parent_path;
27
- this.description = description;
28
- this.created_by_name = created_by_name;
29
- this.allowed_roles = allowed_roles || [];
30
- this.allowed_users = allowed_users || [];
31
- this.is_active = is_active;
32
- }
33
- };
34
- exports.Folder = Folder;
35
- __decorate([
36
- (0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
37
- __metadata("design:type", String)
38
- ], Folder.prototype, "name", void 0);
39
- __decorate([
40
- (0, typeorm_1.Column)({ type: 'varchar', length: 1000 }),
41
- __metadata("design:type", String)
42
- ], Folder.prototype, "path", void 0);
43
- __decorate([
44
- (0, typeorm_1.Column)({ type: 'varchar', length: 1000, nullable: true }),
45
- __metadata("design:type", String)
46
- ], Folder.prototype, "parent_path", void 0);
47
- __decorate([
48
- (0, typeorm_1.ManyToOne)('Departments', { eager: true }),
49
- (0, typeorm_1.JoinColumn)({ name: 'department_id' }),
50
- __metadata("design:type", DepartmentsModel_1.Departments)
51
- ], Folder.prototype, "department", void 0);
52
- __decorate([
53
- (0, typeorm_1.Column)({ type: 'integer' }),
54
- __metadata("design:type", Number)
55
- ], Folder.prototype, "department_id", void 0);
56
- __decorate([
57
- (0, typeorm_1.Column)({ type: 'text', nullable: true }),
58
- __metadata("design:type", String)
59
- ], Folder.prototype, "description", void 0);
60
- __decorate([
61
- (0, typeorm_1.Column)({ type: 'enum', enum: ['general', 'restricted'], default: 'general' }),
62
- (0, typeorm_1.Index)(),
63
- __metadata("design:type", String)
64
- ], Folder.prototype, "access_level", void 0);
65
- __decorate([
66
- (0, typeorm_1.Column)({ type: 'text', array: true, default: [] }),
67
- __metadata("design:type", Array)
68
- ], Folder.prototype, "allowed_roles", void 0);
69
- __decorate([
70
- (0, typeorm_1.Column)({ type: 'text', array: true, default: [] }),
71
- __metadata("design:type", Array)
72
- ], Folder.prototype, "allowed_users", void 0);
73
- __decorate([
74
- (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
75
- __metadata("design:type", String)
76
- ], Folder.prototype, "created_by_name", void 0);
77
- __decorate([
78
- (0, typeorm_1.Column)({ type: 'boolean', default: true }),
79
- (0, typeorm_1.Index)(),
80
- __metadata("design:type", Boolean)
81
- ], Folder.prototype, "is_active", void 0);
82
- exports.Folder = Folder = __decorate([
83
- (0, typeorm_1.Entity)({ name: 'folders' }),
84
- __metadata("design:paramtypes", [String, String, Number, String, String, String, String, String, Array, Array, Boolean])
85
- ], Folder);
@@ -1,18 +0,0 @@
1
- import { Role } from './role';
2
- import { UUIDBaseModel } from './UUIDBaseModel';
3
- export declare enum PermissionType {
4
- VIEW = "view",
5
- UPLOAD = "upload",
6
- UPDATE = "update",
7
- DELETE = "delete",
8
- PUBLISH = "publish"
9
- }
10
- export declare class Permission extends UUIDBaseModel {
11
- name: string;
12
- code: string;
13
- type: PermissionType;
14
- description?: string;
15
- is_active: boolean;
16
- roles: Role[];
17
- constructor(name: string, code: string, type: PermissionType, created_by: string, description?: string, is_active?: boolean);
18
- }
@@ -1,68 +0,0 @@
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.Permission = exports.PermissionType = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const role_1 = require("./role");
15
- const UUIDBaseModel_1 = require("./UUIDBaseModel");
16
- var PermissionType;
17
- (function (PermissionType) {
18
- PermissionType["VIEW"] = "view";
19
- PermissionType["UPLOAD"] = "upload";
20
- PermissionType["UPDATE"] = "update";
21
- PermissionType["DELETE"] = "delete";
22
- PermissionType["PUBLISH"] = "publish";
23
- })(PermissionType || (exports.PermissionType = PermissionType = {}));
24
- let Permission = class Permission extends UUIDBaseModel_1.UUIDBaseModel {
25
- constructor(name, code, type, created_by, description, is_active = true) {
26
- super();
27
- this.name = name;
28
- this.code = code;
29
- this.type = type;
30
- this.created_by = created_by;
31
- this.description = description;
32
- this.is_active = is_active;
33
- }
34
- };
35
- exports.Permission = Permission;
36
- __decorate([
37
- (0, typeorm_1.Column)({ type: 'varchar', length: 100, unique: true }),
38
- __metadata("design:type", String)
39
- ], Permission.prototype, "name", void 0);
40
- __decorate([
41
- (0, typeorm_1.Column)({ type: 'varchar', length: 50, unique: true }),
42
- __metadata("design:type", String)
43
- ], Permission.prototype, "code", void 0);
44
- __decorate([
45
- (0, typeorm_1.Column)({ type: 'enum', enum: PermissionType }),
46
- __metadata("design:type", String)
47
- ], Permission.prototype, "type", void 0);
48
- __decorate([
49
- (0, typeorm_1.Column)({ type: 'text', nullable: true }),
50
- __metadata("design:type", String)
51
- ], Permission.prototype, "description", void 0);
52
- __decorate([
53
- (0, typeorm_1.Column)({ type: 'boolean', default: true }),
54
- __metadata("design:type", Boolean)
55
- ], Permission.prototype, "is_active", void 0);
56
- __decorate([
57
- (0, typeorm_1.ManyToMany)(() => role_1.Role),
58
- (0, typeorm_1.JoinTable)({
59
- name: 'role_permissions',
60
- joinColumn: { name: 'permission_id', referencedColumnName: 'id' },
61
- inverseJoinColumn: { name: 'role_id', referencedColumnName: 'id' },
62
- }),
63
- __metadata("design:type", Array)
64
- ], Permission.prototype, "roles", void 0);
65
- exports.Permission = Permission = __decorate([
66
- (0, typeorm_1.Entity)({ name: 'permissions' }),
67
- __metadata("design:paramtypes", [String, String, String, String, String, Boolean])
68
- ], Permission);
@@ -1,14 +0,0 @@
1
- export declare abstract class UUIDModel0 {
2
- jsonIgnore: string[];
3
- created_by?: string;
4
- created_at?: Date;
5
- updated_by?: string;
6
- updated_at?: Date;
7
- insertCreated(): void;
8
- is_deleted?: boolean;
9
- constructor();
10
- }
11
- export declare abstract class UUIDBaseModel extends UUIDModel0 {
12
- id: string;
13
- constructor();
14
- }
@@ -1,66 +0,0 @@
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.UUIDBaseModel = exports.UUIDModel0 = void 0;
16
- const moment_timezone_1 = __importDefault(require("moment-timezone"));
17
- const typeorm_1 = require("typeorm");
18
- class UUIDModel0 {
19
- insertCreated() {
20
- const currentTime = (0, moment_timezone_1.default)().utc().tz('Asia/Kolkata').toDate();
21
- this.created_at = currentTime;
22
- this.updated_at = currentTime;
23
- }
24
- constructor() {
25
- this.jsonIgnore = ['logicalDelete', 'is_deleted', 'jsonIgnore'];
26
- this.is_deleted = false;
27
- }
28
- }
29
- exports.UUIDModel0 = UUIDModel0;
30
- __decorate([
31
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
32
- __metadata("design:type", String)
33
- ], UUIDModel0.prototype, "created_by", void 0);
34
- __decorate([
35
- (0, typeorm_1.CreateDateColumn)({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" }),
36
- __metadata("design:type", Date)
37
- ], UUIDModel0.prototype, "created_at", void 0);
38
- __decorate([
39
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
40
- __metadata("design:type", String)
41
- ], UUIDModel0.prototype, "updated_by", void 0);
42
- __decorate([
43
- (0, typeorm_1.UpdateDateColumn)({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" }),
44
- __metadata("design:type", Date)
45
- ], UUIDModel0.prototype, "updated_at", void 0);
46
- __decorate([
47
- (0, typeorm_1.BeforeInsert)(),
48
- __metadata("design:type", Function),
49
- __metadata("design:paramtypes", []),
50
- __metadata("design:returntype", void 0)
51
- ], UUIDModel0.prototype, "insertCreated", null);
52
- __decorate([
53
- (0, typeorm_1.Column)({ nullable: true, default: false }),
54
- __metadata("design:type", Boolean)
55
- ], UUIDModel0.prototype, "is_deleted", void 0);
56
- class UUIDBaseModel extends UUIDModel0 {
57
- constructor() {
58
- super();
59
- this.id = ''; // This will be set by the database when the entity is saved
60
- }
61
- }
62
- exports.UUIDBaseModel = UUIDBaseModel;
63
- __decorate([
64
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
65
- __metadata("design:type", String)
66
- ], UUIDBaseModel.prototype, "id", void 0);