@platform-modules/foreign-ministry 1.3.341 → 1.3.350

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 (87) hide show
  1. package/.env +4 -4
  2. package/dist/helpers/employee-evaluation-request.utils.d.ts +6 -0
  3. package/dist/helpers/employee-evaluation-request.utils.js +83 -5
  4. package/dist/helpers/sla-request-status.helper.d.ts +3 -0
  5. package/dist/helpers/sla-request-status.helper.js +36 -0
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.js +4 -3
  8. package/dist/models/EmbassyEvaluationDepartmentSettingModel.d.ts +14 -0
  9. package/dist/models/EmbassyEvaluationDepartmentSettingModel.js +56 -0
  10. package/dist/models/EmployeeEvaluationRequestModel.d.ts +1 -0
  11. package/dist/models/EmployeeEvaluationRequestModel.js +4 -0
  12. package/dist/models/EvaluationMastersModel.d.ts +16 -0
  13. package/dist/models/EvaluationMastersModel.js +67 -0
  14. package/dist/models/EvaluationQuestionMasterModel.d.ts +10 -0
  15. package/dist/models/EvaluationQuestionMasterModel.js +42 -0
  16. package/dist/models/EvaluationSectionMasterModel.d.ts +7 -0
  17. package/dist/models/EvaluationSectionMasterModel.js +36 -0
  18. package/dist/models/EvaluationWorkflowModel.d.ts +60 -0
  19. package/dist/models/EvaluationWorkflowModel.js +215 -0
  20. package/dist/models/IneligibleForEvaluationModel.d.ts +8 -0
  21. package/dist/models/IneligibleForEvaluationModel.js +44 -0
  22. package/dist/models/MissionTravelClassConfigModel.d.ts +10 -0
  23. package/dist/models/MissionTravelClassConfigModel.js +50 -0
  24. package/dist/models/MissionTravelPerdiemModel.d.ts +10 -0
  25. package/dist/models/MissionTravelPerdiemModel.js +54 -0
  26. package/dist/models/MounringLeaveRelationModel.d.ts +1 -0
  27. package/dist/models/MounringLeaveRelationModel.js +4 -0
  28. package/dist/models/SlaApprovalsViewModel.js +47 -47
  29. package/dist/models/SlaMyRequestsViewModel.js +52 -52
  30. package/dist/models/UuidAuditModel.d.ts +9 -0
  31. package/dist/models/UuidAuditModel.js +41 -0
  32. package/package.json +1 -1
  33. package/scripts/check-column-types.js +38 -38
  34. package/scripts/check-service-tables.js +42 -42
  35. package/scripts/sync-sla-reports-sql.js +92 -92
  36. package/sql/add_employee_evaluation_requests_is_draft.sql +2 -0
  37. package/sql/add_mounring_leave_relation_arabic.sql +2 -0
  38. package/sql/sla-reports-sync.manifest.json +9 -9
  39. package/sql/sla_reports_admin_procedures.sql +304 -304
  40. package/sql/sla_reports_approvals_workbook.sql +383 -383
  41. package/sql/sla_reports_procedures.sql +886 -886
  42. package/sql/sla_requests_status_to_varchar.sql +28 -28
  43. package/sql/vw_sla_approvals.sql +108 -108
  44. package/sql/vw_sla_my_requests.sql +55 -55
  45. package/src/data-source.ts +686 -686
  46. package/src/helpers/employee-evaluation-request.utils.ts +87 -7
  47. package/src/helpers/evaluation-eligibility.utils.ts +126 -126
  48. package/src/index.ts +1 -0
  49. package/src/models/DiplomaticAcademyRequestModel.ts +80 -80
  50. package/src/models/DocumentationFileModel.ts +40 -40
  51. package/src/models/EmbassyEvaluationCycleModel.ts +45 -45
  52. package/src/models/EmbassyEvaluationRequestModel.ts +59 -59
  53. package/src/models/EmployeeEvaluationAnswerModel.ts +26 -26
  54. package/src/models/EmployeeEvaluationRequestModel.ts +3 -0
  55. package/src/models/EvaluationEligibilitySettingModel.ts +51 -51
  56. package/src/models/EvaluationFormModel.ts +44 -44
  57. package/src/models/LanguageCourseRequestModel.ts +67 -67
  58. package/src/models/LeaveApprovalsModel.ts +66 -66
  59. package/src/models/LeaveConfigModel.ts +71 -71
  60. package/src/models/MissionTravelApprovalModel.ts +101 -101
  61. package/src/models/MissionTravelAttachmentModel.ts +56 -56
  62. package/src/models/MissionTravelChatModel.ts +52 -52
  63. package/src/models/MissionTravelPersonModel.ts +105 -105
  64. package/src/models/MissionTravelWorkflowModel.ts +54 -54
  65. package/src/models/MounringLeaveRelationModel.ts +3 -0
  66. package/src/models/ProjectContactsModel.ts +51 -51
  67. package/src/models/ProjectFaqModel.ts +36 -36
  68. package/src/models/ProjectInvoicesModel.ts +41 -41
  69. package/src/models/ProjectModel.ts +75 -75
  70. package/src/models/ProjectTasksModel.ts +75 -75
  71. package/src/models/ServiceSlaApprovalModel.ts +63 -63
  72. package/src/models/ServicesNotificationConfigsModel.ts +55 -55
  73. package/src/models/SlaApprovalsViewModel.ts +135 -135
  74. package/src/models/SlaMyRequestsViewModel.ts +172 -172
  75. package/src/models/SlaRequestModel.ts +57 -57
  76. package/src/sla-report-views.ts +3 -3
  77. package/dist/auth/authenticate-jwt-session.d.ts +0 -19
  78. package/dist/auth/authenticate-jwt-session.js +0 -35
  79. package/dist/auth/jwt-token.helper.d.ts +0 -18
  80. package/dist/auth/jwt-token.helper.js +0 -58
  81. package/dist/auth/user-session-validation.d.ts +0 -42
  82. package/dist/auth/user-session-validation.js +0 -95
  83. package/dist/i18n/workflow-chat-i18n.d.ts +0 -5
  84. package/dist/i18n/workflow-chat-i18n.js +0 -21
  85. package/dist/i18n/workflow-chat-i18n.json +0 -320
  86. package/dist/i18n/workflow-chat-message.builder.d.ts +0 -325
  87. package/dist/i18n/workflow-chat-message.builder.js +0 -924
@@ -1,41 +1,41 @@
1
- import { Column, Entity } from 'typeorm';
2
- import { BaseModel } from './BaseModel';
3
-
4
- @Entity({ name: 'project_invoices' })
5
- export class ProjectInvoices extends BaseModel {
6
- @Column({ type: 'int' })
7
- project_id: number;
8
-
9
- /** Optional link to a project milestone (same project). */
10
- @Column({ type: 'int', nullable: true })
11
- milestone_id: number | null;
12
-
13
- @Column({ type: 'text', nullable: true })
14
- invoice_link: string;
15
-
16
- @Column({ type: 'varchar', length: 500, nullable: true })
17
- filename: string;
18
-
19
- @Column({ type: 'bigint', nullable: true })
20
- filesize: number;
21
-
22
- @Column({ type: 'varchar', length: 100, nullable: true })
23
- filetype: string;
24
-
25
- constructor(
26
- project_id?: number,
27
- milestone_id?: number | null,
28
- invoice_link?: string,
29
- filename?: string,
30
- filesize?: number,
31
- filetype?: string
32
- ) {
33
- super();
34
- this.project_id = project_id ?? 0;
35
- this.milestone_id = milestone_id ?? null;
36
- this.invoice_link = invoice_link ?? '';
37
- this.filename = filename ?? '';
38
- this.filesize = filesize ?? 0;
39
- this.filetype = filetype ?? '';
40
- }
41
- }
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'project_invoices' })
5
+ export class ProjectInvoices extends BaseModel {
6
+ @Column({ type: 'int' })
7
+ project_id: number;
8
+
9
+ /** Optional link to a project milestone (same project). */
10
+ @Column({ type: 'int', nullable: true })
11
+ milestone_id: number | null;
12
+
13
+ @Column({ type: 'text', nullable: true })
14
+ invoice_link: string;
15
+
16
+ @Column({ type: 'varchar', length: 500, nullable: true })
17
+ filename: string;
18
+
19
+ @Column({ type: 'bigint', nullable: true })
20
+ filesize: number;
21
+
22
+ @Column({ type: 'varchar', length: 100, nullable: true })
23
+ filetype: string;
24
+
25
+ constructor(
26
+ project_id?: number,
27
+ milestone_id?: number | null,
28
+ invoice_link?: string,
29
+ filename?: string,
30
+ filesize?: number,
31
+ filetype?: string
32
+ ) {
33
+ super();
34
+ this.project_id = project_id ?? 0;
35
+ this.milestone_id = milestone_id ?? null;
36
+ this.invoice_link = invoice_link ?? '';
37
+ this.filename = filename ?? '';
38
+ this.filesize = filesize ?? 0;
39
+ this.filetype = filetype ?? '';
40
+ }
41
+ }
@@ -1,75 +1,75 @@
1
- import { Column, Entity } from 'typeorm';
2
- import { BaseModel } from './BaseModel';
3
-
4
- @Entity({ name: 'projects' })
5
- export class Projects extends BaseModel {
6
- @Column({ type: 'varchar', length: 255 })
7
- project_name: string;
8
-
9
- @Column({ type: 'text' , nullable: true})
10
- project_objective: string;
11
-
12
- @Column({ type: 'text' , nullable: true})
13
- project_benefits: string;
14
-
15
- @Column({ type: 'text' , nullable: true})
16
- project_risks: string;
17
-
18
- @Column({ type: 'text' , nullable: true})
19
- project_challenges: string;
20
-
21
- @Column({ type: 'text' , nullable: true})
22
- project_description: string;
23
-
24
- @Column({ type: 'text' , nullable: true})
25
- project_status: string;
26
-
27
- @Column({ type: 'text' , nullable: true})
28
- roadmap_link: string;
29
-
30
- @Column({ type: 'jsonb' , nullable: true})
31
- template_ids: number[] | null;
32
-
33
- @Column({ name: 'start_date', type: 'date', nullable: true })
34
- startDate: Date | null;
35
-
36
- @Column({ name: 'end_date', type: 'date', nullable: true })
37
- endDate: Date | null;
38
-
39
- @Column({ type: 'varchar', length: 100, nullable: true})
40
- project_version: string;
41
-
42
- @Column({ type: 'int', default: 0, nullable: true })
43
- no_of_phases: number;
44
-
45
- constructor(
46
- project_name?: string,
47
- project_objective?: string,
48
- project_benefits?: string,
49
- project_risks?: string,
50
- project_challenges?: string,
51
- project_description?: string,
52
- project_status?: string,
53
- roadmap_link?: string | null,
54
- template_ids?: number[] | null,
55
- startDate?: Date | null,
56
- endDate?: Date | null,
57
- project_version?: string,
58
- no_of_phases?: number
59
- ) {
60
- super();
61
- this.project_name = project_name || '';
62
- this.project_objective = project_objective || '';
63
- this.project_benefits = project_benefits || '';
64
- this.project_risks = project_risks || '';
65
- this.project_challenges = project_challenges || '';
66
- this.project_description = project_description || '';
67
- this.project_status = project_status || '';
68
- this.roadmap_link = roadmap_link || '';
69
- this.template_ids = template_ids || [];
70
- this.startDate = startDate ?? null;
71
- this.endDate = endDate ?? null;
72
- this.project_version = project_version || '';
73
- this.no_of_phases = no_of_phases ?? 0;
74
- }
75
- }
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'projects' })
5
+ export class Projects extends BaseModel {
6
+ @Column({ type: 'varchar', length: 255 })
7
+ project_name: string;
8
+
9
+ @Column({ type: 'text' , nullable: true})
10
+ project_objective: string;
11
+
12
+ @Column({ type: 'text' , nullable: true})
13
+ project_benefits: string;
14
+
15
+ @Column({ type: 'text' , nullable: true})
16
+ project_risks: string;
17
+
18
+ @Column({ type: 'text' , nullable: true})
19
+ project_challenges: string;
20
+
21
+ @Column({ type: 'text' , nullable: true})
22
+ project_description: string;
23
+
24
+ @Column({ type: 'text' , nullable: true})
25
+ project_status: string;
26
+
27
+ @Column({ type: 'text' , nullable: true})
28
+ roadmap_link: string;
29
+
30
+ @Column({ type: 'jsonb' , nullable: true})
31
+ template_ids: number[] | null;
32
+
33
+ @Column({ name: 'start_date', type: 'date', nullable: true })
34
+ startDate: Date | null;
35
+
36
+ @Column({ name: 'end_date', type: 'date', nullable: true })
37
+ endDate: Date | null;
38
+
39
+ @Column({ type: 'varchar', length: 100, nullable: true})
40
+ project_version: string;
41
+
42
+ @Column({ type: 'int', default: 0, nullable: true })
43
+ no_of_phases: number;
44
+
45
+ constructor(
46
+ project_name?: string,
47
+ project_objective?: string,
48
+ project_benefits?: string,
49
+ project_risks?: string,
50
+ project_challenges?: string,
51
+ project_description?: string,
52
+ project_status?: string,
53
+ roadmap_link?: string | null,
54
+ template_ids?: number[] | null,
55
+ startDate?: Date | null,
56
+ endDate?: Date | null,
57
+ project_version?: string,
58
+ no_of_phases?: number
59
+ ) {
60
+ super();
61
+ this.project_name = project_name || '';
62
+ this.project_objective = project_objective || '';
63
+ this.project_benefits = project_benefits || '';
64
+ this.project_risks = project_risks || '';
65
+ this.project_challenges = project_challenges || '';
66
+ this.project_description = project_description || '';
67
+ this.project_status = project_status || '';
68
+ this.roadmap_link = roadmap_link || '';
69
+ this.template_ids = template_ids || [];
70
+ this.startDate = startDate ?? null;
71
+ this.endDate = endDate ?? null;
72
+ this.project_version = project_version || '';
73
+ this.no_of_phases = no_of_phases ?? 0;
74
+ }
75
+ }
@@ -1,75 +1,75 @@
1
- import { Column, Entity } from 'typeorm';
2
- import { BaseModel } from './BaseModel';
3
-
4
- export interface TaskAttachmentItem {
5
- link?: string;
6
- filename?: string;
7
- filesize?: number;
8
- filetype?: string;
9
- }
10
-
11
- export const TASK_PRIORITY = ['low', 'medium', 'high'] as const;
12
- export const TASK_STATUS = ['Not started', 'Pending', 'In Progress', 'Completed'] as const;
13
-
14
- @Entity({ name: 'project_tasks' })
15
- export class ProjectTasks extends BaseModel {
16
- @Column({ type: 'int' })
17
- project_id: number;
18
-
19
- @Column({ type: 'varchar', length: 500 })
20
- task_title: string;
21
-
22
- @Column({ type: 'text', nullable: true })
23
- task_description: string;
24
-
25
- @Column({ type: 'jsonb', nullable: true })
26
- attachments: TaskAttachmentItem[] | null;
27
-
28
- @Column({ type: 'varchar', length: 20, default: 'medium' })
29
- priority: string;
30
-
31
- @Column({ type: 'varchar', length: 50, default: 'Not started' })
32
- status: string;
33
-
34
- @Column({ type: 'int', nullable: true })
35
- milestone_id: number | null;
36
-
37
- @Column({ type: 'int', default: 1, nullable: true })
38
- phase: number;
39
-
40
- @Column({ type: 'int', nullable: true })
41
- manager_id: number | null;
42
-
43
- @Column({ type: 'date', nullable: true })
44
- start_date: Date | null;
45
-
46
- @Column({ type: 'date', nullable: true })
47
- end_date: Date | null;
48
-
49
- constructor(
50
- project_id?: number,
51
- task_title?: string,
52
- task_description?: string,
53
- attachments?: TaskAttachmentItem[] | null,
54
- priority?: string,
55
- status?: string,
56
- milestone_id?: number | null,
57
- phase?: number,
58
- manager_id?: number | null,
59
- start_date?: Date | null,
60
- end_date?: Date | null
61
- ) {
62
- super();
63
- this.project_id = project_id ?? 0;
64
- this.task_title = task_title ?? '';
65
- this.task_description = task_description ?? '';
66
- this.attachments = attachments ?? null;
67
- this.priority = priority ?? 'medium';
68
- this.status = status ?? 'Not started';
69
- this.milestone_id = milestone_id ?? null;
70
- this.phase = phase ?? 1;
71
- this.manager_id = manager_id ?? null;
72
- this.start_date = start_date ?? null;
73
- this.end_date = end_date ?? null;
74
- }
75
- }
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export interface TaskAttachmentItem {
5
+ link?: string;
6
+ filename?: string;
7
+ filesize?: number;
8
+ filetype?: string;
9
+ }
10
+
11
+ export const TASK_PRIORITY = ['low', 'medium', 'high'] as const;
12
+ export const TASK_STATUS = ['Not started', 'Pending', 'In Progress', 'Completed'] as const;
13
+
14
+ @Entity({ name: 'project_tasks' })
15
+ export class ProjectTasks extends BaseModel {
16
+ @Column({ type: 'int' })
17
+ project_id: number;
18
+
19
+ @Column({ type: 'varchar', length: 500 })
20
+ task_title: string;
21
+
22
+ @Column({ type: 'text', nullable: true })
23
+ task_description: string;
24
+
25
+ @Column({ type: 'jsonb', nullable: true })
26
+ attachments: TaskAttachmentItem[] | null;
27
+
28
+ @Column({ type: 'varchar', length: 20, default: 'medium' })
29
+ priority: string;
30
+
31
+ @Column({ type: 'varchar', length: 50, default: 'Not started' })
32
+ status: string;
33
+
34
+ @Column({ type: 'int', nullable: true })
35
+ milestone_id: number | null;
36
+
37
+ @Column({ type: 'int', default: 1, nullable: true })
38
+ phase: number;
39
+
40
+ @Column({ type: 'int', nullable: true })
41
+ manager_id: number | null;
42
+
43
+ @Column({ type: 'date', nullable: true })
44
+ start_date: Date | null;
45
+
46
+ @Column({ type: 'date', nullable: true })
47
+ end_date: Date | null;
48
+
49
+ constructor(
50
+ project_id?: number,
51
+ task_title?: string,
52
+ task_description?: string,
53
+ attachments?: TaskAttachmentItem[] | null,
54
+ priority?: string,
55
+ status?: string,
56
+ milestone_id?: number | null,
57
+ phase?: number,
58
+ manager_id?: number | null,
59
+ start_date?: Date | null,
60
+ end_date?: Date | null
61
+ ) {
62
+ super();
63
+ this.project_id = project_id ?? 0;
64
+ this.task_title = task_title ?? '';
65
+ this.task_description = task_description ?? '';
66
+ this.attachments = attachments ?? null;
67
+ this.priority = priority ?? 'medium';
68
+ this.status = status ?? 'Not started';
69
+ this.milestone_id = milestone_id ?? null;
70
+ this.phase = phase ?? 1;
71
+ this.manager_id = manager_id ?? null;
72
+ this.start_date = start_date ?? null;
73
+ this.end_date = end_date ?? null;
74
+ }
75
+ }
@@ -1,63 +1,63 @@
1
- import { Column, Entity, Index } from "typeorm";
2
-
3
- import { BaseModel } from "./BaseModel";
4
-
5
-
6
-
7
- @Entity({ name: "sla_approval" })
8
- @Index("idx_sla_approval_request_id", ["request_id"])
9
- @Index("idx_sla_approval_source_approval_id", ["source_approval_id"])
10
- @Index("idx_sla_approval_service_subservice", ["service_id", "sub_service_id"])
11
- @Index("idx_sla_approval_approval_status", ["approval_status"])
12
- @Index("idx_sla_approval_level", ["level"])
13
- @Index("idx_sla_approval_approver_user_id", ["approver_user_id"])
14
- @Index("idx_sla_approval_delegate_user_id", ["delegate_user_id"])
15
- @Index("idx_sla_approval_request_level", ["request_id", "level"])
16
- @Index("idx_sla_approval_svc_sub_status", ["service_id", "sub_service_id", "approval_status"])
17
-
18
- export class ServiceSlaApproval extends BaseModel {
19
-
20
- @Column({ type: "int" })
21
- request_id: number;
22
-
23
- @Column({ type: "int" })
24
- source_approval_id: number;
25
-
26
- @Column({ type: "int", nullable: true })
27
- service_id: number | null;
28
-
29
- @Column({ type: "int", nullable: true })
30
- sub_service_id: number | null;
31
-
32
- @Column({ type: "varchar", length: 64 })
33
- approval_status: string;
34
-
35
- @Column({ type: "int" })
36
- level: number;
37
-
38
- @Column({ type: "int", nullable: true })
39
- approver_role_id: number | null;
40
-
41
- @Column({ type: "int", nullable: true })
42
- department_id: number | null;
43
-
44
- @Column({ type: "int", nullable: true })
45
- section_id: number | null;
46
-
47
- @Column({ type: "int", nullable: true })
48
- approver_user_id: number | null;
49
-
50
- @Column({ type: "int", nullable: true })
51
- delegate_user_id: number | null;
52
-
53
- @Column({ type: "int", nullable: true })
54
- approved_by: number | null;
55
-
56
- @Column({ type: "varchar", length: 500, nullable: true, default: "" })
57
- comment: string;
58
-
59
- @Column({ type: "boolean", default: true, nullable: false })
60
- is_allowed: boolean;
61
-
62
- }
63
-
1
+ import { Column, Entity, Index } from "typeorm";
2
+
3
+ import { BaseModel } from "./BaseModel";
4
+
5
+
6
+
7
+ @Entity({ name: "sla_approval" })
8
+ @Index("idx_sla_approval_request_id", ["request_id"])
9
+ @Index("idx_sla_approval_source_approval_id", ["source_approval_id"])
10
+ @Index("idx_sla_approval_service_subservice", ["service_id", "sub_service_id"])
11
+ @Index("idx_sla_approval_approval_status", ["approval_status"])
12
+ @Index("idx_sla_approval_level", ["level"])
13
+ @Index("idx_sla_approval_approver_user_id", ["approver_user_id"])
14
+ @Index("idx_sla_approval_delegate_user_id", ["delegate_user_id"])
15
+ @Index("idx_sla_approval_request_level", ["request_id", "level"])
16
+ @Index("idx_sla_approval_svc_sub_status", ["service_id", "sub_service_id", "approval_status"])
17
+
18
+ export class ServiceSlaApproval extends BaseModel {
19
+
20
+ @Column({ type: "int" })
21
+ request_id: number;
22
+
23
+ @Column({ type: "int" })
24
+ source_approval_id: number;
25
+
26
+ @Column({ type: "int", nullable: true })
27
+ service_id: number | null;
28
+
29
+ @Column({ type: "int", nullable: true })
30
+ sub_service_id: number | null;
31
+
32
+ @Column({ type: "varchar", length: 64 })
33
+ approval_status: string;
34
+
35
+ @Column({ type: "int" })
36
+ level: number;
37
+
38
+ @Column({ type: "int", nullable: true })
39
+ approver_role_id: number | null;
40
+
41
+ @Column({ type: "int", nullable: true })
42
+ department_id: number | null;
43
+
44
+ @Column({ type: "int", nullable: true })
45
+ section_id: number | null;
46
+
47
+ @Column({ type: "int", nullable: true })
48
+ approver_user_id: number | null;
49
+
50
+ @Column({ type: "int", nullable: true })
51
+ delegate_user_id: number | null;
52
+
53
+ @Column({ type: "int", nullable: true })
54
+ approved_by: number | null;
55
+
56
+ @Column({ type: "varchar", length: 500, nullable: true, default: "" })
57
+ comment: string;
58
+
59
+ @Column({ type: "boolean", default: true, nullable: false })
60
+ is_allowed: boolean;
61
+
62
+ }
63
+
@@ -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
- department_id: number;
13
-
14
- @Column({ type: "integer", nullable: true })
15
- section_id: number | null;
16
-
17
- @Column({ type: "integer", nullable: false })
18
- service_id: number;
19
-
20
- @Column({ type: "integer", nullable: true })
21
- sub_service_id: number | null;
22
-
23
- @Column({ type: "integer", nullable: true })
24
- role_id: number;
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
- department_id: number,
39
- section_id: number | null = null,
40
- service_id: number,
41
- sub_service_id: number | null = null,
42
- role_id: number,
43
- trigger: ServicesNotificationTriggerType = ServicesNotificationTriggerType.FINAL_APPROVAL,
44
- is_active: boolean = true
45
- ) {
46
- super();
47
- this.department_id = department_id;
48
- this.section_id = section_id;
49
- this.service_id = service_id;
50
- this.sub_service_id = sub_service_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
+ department_id: number;
13
+
14
+ @Column({ type: "integer", nullable: true })
15
+ section_id: number | null;
16
+
17
+ @Column({ type: "integer", nullable: false })
18
+ service_id: number;
19
+
20
+ @Column({ type: "integer", nullable: true })
21
+ sub_service_id: number | null;
22
+
23
+ @Column({ type: "integer", nullable: true })
24
+ role_id: number;
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
+ department_id: number,
39
+ section_id: number | null = null,
40
+ service_id: number,
41
+ sub_service_id: number | null = null,
42
+ role_id: number,
43
+ trigger: ServicesNotificationTriggerType = ServicesNotificationTriggerType.FINAL_APPROVAL,
44
+ is_active: boolean = true
45
+ ) {
46
+ super();
47
+ this.department_id = department_id;
48
+ this.section_id = section_id;
49
+ this.service_id = service_id;
50
+ this.sub_service_id = sub_service_id;
51
+ this.role_id = role_id;
52
+ this.trigger = trigger;
53
+ this.is_active = is_active;
54
+ }
55
+ }