@platform-modules/civil-aviation-authority 2.3.310 → 2.3.312
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/dist/data-source.js +2 -0
- package/dist/i18n/workflow-chat-i18n.json +8 -0
- package/dist/i18n/workflow-chat-message.builder.d.ts +1 -1
- package/dist/i18n/workflow-chat-message.builder.js +21 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/models/ChatbotQnsAnsMappingModel.d.ts +8 -0
- package/dist/models/ChatbotQnsAnsMappingModel.js +40 -0
- package/dist/models/DocumentMetadataModel.d.ts +45 -0
- package/dist/models/DocumentMetadataModel.js +171 -0
- package/dist/models/DocumentationDepartmentsModel.d.ts +13 -0
- package/dist/models/DocumentationDepartmentsModel.js +53 -0
- package/dist/models/FolderModel.d.ts +16 -0
- package/dist/models/FolderModel.js +85 -0
- package/dist/models/ImportExportMaterialModels.d.ts +92 -0
- package/dist/models/ImportExportMaterialModels.js +307 -0
- package/dist/models/PermissionModel.d.ts +18 -0
- package/dist/models/PermissionModel.js +68 -0
- package/dist/models/SecurityAccessApprovalModel.d.ts +23 -0
- package/dist/models/SecurityAccessApprovalModel.js +82 -0
- package/dist/models/SecurityAccessAttachmentModel.d.ts +12 -0
- package/dist/models/SecurityAccessAttachmentModel.js +56 -0
- package/dist/models/SecurityAccessChatModel.d.ts +12 -0
- package/dist/models/SecurityAccessChatModel.js +56 -0
- package/dist/models/SecurityAccessRequestModel.d.ts +25 -0
- package/dist/models/SecurityAccessRequestModel.js +80 -0
- package/dist/models/SecurityAccessWorkflowModel.d.ts +24 -0
- package/dist/models/SecurityAccessWorkflowModel.js +84 -0
- package/dist/models/ServiceExtensionAfterAge60Models.d.ts +93 -0
- package/dist/models/ServiceExtensionAfterAge60Models.js +312 -0
- package/dist/models/SlaApprovalsViewModel.js +54 -47
- package/dist/models/SlaMyRequestsViewModel.d.ts +3 -0
- package/dist/models/SlaMyRequestsViewModel.js +22 -2
- package/dist/models/UUIDBaseModel.d.ts +14 -0
- package/dist/models/UUIDBaseModel.js +66 -0
- package/dist/models/WorkingHoursExtensionModels.d.ts +88 -0
- package/dist/models/WorkingHoursExtensionModels.js +295 -0
- package/package.json +1 -1
- package/scripts/sync-sla-reports-sql.js +92 -92
- package/sql/README.md +21 -21
- package/sql/create_chatbot_qns_ans_mapping.sql +25 -0
- package/sql/sla_reports_admin_procedures.sql +323 -304
- package/sql/sla_reports_approvals_workbook.sql +430 -383
- package/sql/sla_reports_procedures.sql +886 -886
- package/sql/user_role_department_section_validation.sql +214 -0
- package/sql/vw_sla_approvals.sql +115 -108
- package/sql/vw_sla_my_requests.sql +58 -53
- package/src/data-source.ts +2 -0
- package/src/i18n/workflow-chat-i18n.json +8 -0
- package/src/i18n/workflow-chat-message.builder.ts +27 -3
- package/src/index.ts +1 -0
- package/src/models/AccessCardRequestModel.ts +135 -135
- package/src/models/AirportEntryPermitModel.ts +276 -276
- package/src/models/AnnualTrainingPlanRequestModel.ts +153 -153
- package/src/models/ChatbotQnsAnsMappingModel.ts +21 -0
- package/src/models/DocumentDriveModel.ts +28 -28
- package/src/models/DocumentFolderModel.ts +45 -45
- package/src/models/HotelApprovalModel.ts +83 -83
- package/src/models/HousingContractCancelApprovalModel.ts +64 -64
- package/src/models/HousingContractRenewalApprovalModel.ts +64 -64
- package/src/models/ITRequestAttachmentModel.ts +73 -73
- package/src/models/ItApprovalsModel.ts +84 -84
- package/src/models/LegalConsultationApprovalModel.ts +65 -65
- package/src/models/MissionTravelPassportExpiryNotificationConfigModel.ts +36 -36
- package/src/models/NotificationModel.ts +89 -89
- package/src/models/ResidentialUnitRentalApprovalModel.ts +143 -143
- package/src/models/ServiceExtensionAfter60ApprovalModel.ts +87 -87
- package/src/models/ServiceSlaApprovalModel.ts +64 -64
- package/src/models/ServicesNotificationConfigModel.ts +55 -55
- package/src/models/SlaApprovalsViewModel.ts +142 -135
- package/src/models/SlaMyRequestsViewModel.ts +21 -1
- package/src/models/StudyLeaveRequestModel.ts +144 -144
- package/src/models/TrainingRequestModel.ts +164 -164
- package/src/models/TrainingRoomBookingRequestModel.ts +142 -142
- package/src/models/TrainingRoomNotificationConfigModel.ts +30 -30
- package/src/models/role.ts +34 -34
- package/src/sla/sla-table-sync.service.ts +90 -90
- package/dist/helpers/cancellation-bilingual-persist.helper.d.ts +0 -37
- package/dist/helpers/cancellation-bilingual-persist.helper.js +0 -77
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from "./BaseModel";
|
|
3
|
-
|
|
4
|
-
export enum ServiceExtensionAfter60ApprovalStatus {
|
|
5
|
-
PENDING = "Pending",
|
|
6
|
-
IN_PROGRESS = "In Progress",
|
|
7
|
-
APPROVED = "Approved",
|
|
8
|
-
REJECTED = "Rejected"
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@Entity({ name: "service_extension_after_60_approvals" })
|
|
12
|
-
export class ServiceExtensionAfter60Approval extends BaseModel {
|
|
13
|
-
@Column({ type: "integer", nullable: false })
|
|
14
|
-
request_id: number;
|
|
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
|
-
level: number;
|
|
24
|
-
|
|
25
|
-
@Column({ type: "integer", nullable: true })
|
|
26
|
-
approver_role_id: number;
|
|
27
|
-
|
|
28
|
-
@Column({ type: "integer", nullable: true })
|
|
29
|
-
department_id: number | null;
|
|
30
|
-
|
|
31
|
-
@Column({ type: "integer", nullable: true })
|
|
32
|
-
section_id: number | null;
|
|
33
|
-
|
|
34
|
-
@Column({ type: "integer", nullable: true })
|
|
35
|
-
approver_user_id: number | null;
|
|
36
|
-
|
|
37
|
-
@Column({ type: "integer", nullable: true })
|
|
38
|
-
delegate_user_id: number | null;
|
|
39
|
-
|
|
40
|
-
@Column({ type: "integer", nullable: true })
|
|
41
|
-
approved_by: number | null;
|
|
42
|
-
|
|
43
|
-
@Column({ type: "varchar", length: 500, nullable: true, default: "" })
|
|
44
|
-
comment: string;
|
|
45
|
-
|
|
46
|
-
@Column({
|
|
47
|
-
type: "enum",
|
|
48
|
-
enum: ServiceExtensionAfter60ApprovalStatus,
|
|
49
|
-
default: ServiceExtensionAfter60ApprovalStatus.PENDING,
|
|
50
|
-
nullable: false
|
|
51
|
-
})
|
|
52
|
-
approval_status: ServiceExtensionAfter60ApprovalStatus;
|
|
53
|
-
|
|
54
|
-
@Column({ type: "boolean", default: true, nullable: false })
|
|
55
|
-
is_allowed: boolean;
|
|
56
|
-
|
|
57
|
-
constructor(
|
|
58
|
-
request_id: number,
|
|
59
|
-
approver_role_id: number,
|
|
60
|
-
level: number,
|
|
61
|
-
comment: string,
|
|
62
|
-
approval_status: ServiceExtensionAfter60ApprovalStatus,
|
|
63
|
-
service_id?: number,
|
|
64
|
-
sub_service_id?: number,
|
|
65
|
-
department_id?: number | null,
|
|
66
|
-
section_id?: number | null,
|
|
67
|
-
approver_user_id?: number | null,
|
|
68
|
-
delegate_user_id?: number | null,
|
|
69
|
-
approved_by?: number | null,
|
|
70
|
-
is_allowed?: boolean
|
|
71
|
-
) {
|
|
72
|
-
super();
|
|
73
|
-
this.request_id = request_id;
|
|
74
|
-
this.service_id = service_id ?? null;
|
|
75
|
-
this.sub_service_id = sub_service_id ?? null;
|
|
76
|
-
this.level = level;
|
|
77
|
-
this.approver_role_id = approver_role_id;
|
|
78
|
-
this.department_id = department_id ?? null;
|
|
79
|
-
this.section_id = section_id ?? null;
|
|
80
|
-
this.approver_user_id = approver_user_id ?? null;
|
|
81
|
-
this.delegate_user_id = delegate_user_id ?? null;
|
|
82
|
-
this.approved_by = approved_by ?? null;
|
|
83
|
-
this.comment = comment;
|
|
84
|
-
this.approval_status = approval_status;
|
|
85
|
-
this.is_allowed = is_allowed !== undefined ? is_allowed : true;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
export enum ServiceExtensionAfter60ApprovalStatus {
|
|
5
|
+
PENDING = "Pending",
|
|
6
|
+
IN_PROGRESS = "In Progress",
|
|
7
|
+
APPROVED = "Approved",
|
|
8
|
+
REJECTED = "Rejected"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Entity({ name: "service_extension_after_60_approvals" })
|
|
12
|
+
export class ServiceExtensionAfter60Approval extends BaseModel {
|
|
13
|
+
@Column({ type: "integer", nullable: false })
|
|
14
|
+
request_id: number;
|
|
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
|
+
level: number;
|
|
24
|
+
|
|
25
|
+
@Column({ type: "integer", nullable: true })
|
|
26
|
+
approver_role_id: number;
|
|
27
|
+
|
|
28
|
+
@Column({ type: "integer", nullable: true })
|
|
29
|
+
department_id: number | null;
|
|
30
|
+
|
|
31
|
+
@Column({ type: "integer", nullable: true })
|
|
32
|
+
section_id: number | null;
|
|
33
|
+
|
|
34
|
+
@Column({ type: "integer", nullable: true })
|
|
35
|
+
approver_user_id: number | null;
|
|
36
|
+
|
|
37
|
+
@Column({ type: "integer", nullable: true })
|
|
38
|
+
delegate_user_id: number | null;
|
|
39
|
+
|
|
40
|
+
@Column({ type: "integer", nullable: true })
|
|
41
|
+
approved_by: number | null;
|
|
42
|
+
|
|
43
|
+
@Column({ type: "varchar", length: 500, nullable: true, default: "" })
|
|
44
|
+
comment: string;
|
|
45
|
+
|
|
46
|
+
@Column({
|
|
47
|
+
type: "enum",
|
|
48
|
+
enum: ServiceExtensionAfter60ApprovalStatus,
|
|
49
|
+
default: ServiceExtensionAfter60ApprovalStatus.PENDING,
|
|
50
|
+
nullable: false
|
|
51
|
+
})
|
|
52
|
+
approval_status: ServiceExtensionAfter60ApprovalStatus;
|
|
53
|
+
|
|
54
|
+
@Column({ type: "boolean", default: true, nullable: false })
|
|
55
|
+
is_allowed: boolean;
|
|
56
|
+
|
|
57
|
+
constructor(
|
|
58
|
+
request_id: number,
|
|
59
|
+
approver_role_id: number,
|
|
60
|
+
level: number,
|
|
61
|
+
comment: string,
|
|
62
|
+
approval_status: ServiceExtensionAfter60ApprovalStatus,
|
|
63
|
+
service_id?: number,
|
|
64
|
+
sub_service_id?: number,
|
|
65
|
+
department_id?: number | null,
|
|
66
|
+
section_id?: number | null,
|
|
67
|
+
approver_user_id?: number | null,
|
|
68
|
+
delegate_user_id?: number | null,
|
|
69
|
+
approved_by?: number | null,
|
|
70
|
+
is_allowed?: boolean
|
|
71
|
+
) {
|
|
72
|
+
super();
|
|
73
|
+
this.request_id = request_id;
|
|
74
|
+
this.service_id = service_id ?? null;
|
|
75
|
+
this.sub_service_id = sub_service_id ?? null;
|
|
76
|
+
this.level = level;
|
|
77
|
+
this.approver_role_id = approver_role_id;
|
|
78
|
+
this.department_id = department_id ?? null;
|
|
79
|
+
this.section_id = section_id ?? null;
|
|
80
|
+
this.approver_user_id = approver_user_id ?? null;
|
|
81
|
+
this.delegate_user_id = delegate_user_id ?? null;
|
|
82
|
+
this.approved_by = approved_by ?? null;
|
|
83
|
+
this.comment = comment;
|
|
84
|
+
this.approval_status = approval_status;
|
|
85
|
+
this.is_allowed = is_allowed !== undefined ? is_allowed : true;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { Column, Entity, Index } from "typeorm";
|
|
2
|
-
import { BaseModel } from "./BaseModel";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Cross-service SLA tracking row for any microservice (HR, IT, Tender, …).
|
|
6
|
-
* Segregated by service_id, sub_service_id, request_id.
|
|
7
|
-
* source_approval_id = native approval row PK in the owning service (e.g. hr_service_approvals.id, vpn_approvals.id); not a DB FK.
|
|
8
|
-
*/
|
|
9
|
-
@Entity({ name: "sla_approval" })
|
|
10
|
-
@Index("idx_sla_approval_request_id", ["request_id"])
|
|
11
|
-
@Index("idx_sla_approval_source_approval_id", ["source_approval_id"])
|
|
12
|
-
@Index("idx_sla_approval_service_subservice", ["service_id", "sub_service_id"])
|
|
13
|
-
@Index("idx_sla_approval_approval_status", ["approval_status"])
|
|
14
|
-
@Index("idx_sla_approval_level", ["level"])
|
|
15
|
-
@Index("idx_sla_approval_approver_user_id", ["approver_user_id"])
|
|
16
|
-
@Index("idx_sla_approval_request_level", ["request_id", "level"])
|
|
17
|
-
@Index("idx_sla_approval_svc_sub_status", ["service_id", "sub_service_id", "approval_status"])
|
|
18
|
-
export class ServiceSlaApproval extends BaseModel {
|
|
19
|
-
@Column({ type: "int" })
|
|
20
|
-
request_id: number;
|
|
21
|
-
|
|
22
|
-
@Column({ type: "int" })
|
|
23
|
-
source_approval_id: number;
|
|
24
|
-
|
|
25
|
-
@Column({ type: "int", nullable: true })
|
|
26
|
-
service_id: number | null;
|
|
27
|
-
|
|
28
|
-
@Column({ type: "int", nullable: true })
|
|
29
|
-
sub_service_id: number | null;
|
|
30
|
-
|
|
31
|
-
@Column({ type: "varchar", length: 64 })
|
|
32
|
-
approval_status: string;
|
|
33
|
-
|
|
34
|
-
@Column({ type: "int" })
|
|
35
|
-
level: number;
|
|
36
|
-
|
|
37
|
-
@Column({ type: "int", nullable: true })
|
|
38
|
-
approver_user_id: number | null;
|
|
39
|
-
|
|
40
|
-
@Column({ type: "int", nullable: true })
|
|
41
|
-
approver_role_id: number | null;
|
|
42
|
-
|
|
43
|
-
@Column({ type: "int", nullable: true })
|
|
44
|
-
department_id: number | null;
|
|
45
|
-
|
|
46
|
-
@Column({ type: "int", nullable: true })
|
|
47
|
-
section_id: number | null;
|
|
48
|
-
|
|
49
|
-
/** Mirrors native approval `delegate_user_id` (IT master tables may use `delegation_user_id`). */
|
|
50
|
-
@Column({ type: "int", nullable: true })
|
|
51
|
-
delegate_user_id: number | null;
|
|
52
|
-
|
|
53
|
-
/** Mirrors native approval `approved_by` (acting user when status was last resolved). */
|
|
54
|
-
@Column({ type: "int", nullable: true })
|
|
55
|
-
approved_by: number | null;
|
|
56
|
-
|
|
57
|
-
/** Mirrors native approval comment / rejection reason. */
|
|
58
|
-
@Column({ type: "varchar", length: 255, nullable: true })
|
|
59
|
-
comment: string | null;
|
|
60
|
-
|
|
61
|
-
constructor() {
|
|
62
|
-
super();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
1
|
+
import { Column, Entity, Index } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Cross-service SLA tracking row for any microservice (HR, IT, Tender, …).
|
|
6
|
+
* Segregated by service_id, sub_service_id, request_id.
|
|
7
|
+
* source_approval_id = native approval row PK in the owning service (e.g. hr_service_approvals.id, vpn_approvals.id); not a DB FK.
|
|
8
|
+
*/
|
|
9
|
+
@Entity({ name: "sla_approval" })
|
|
10
|
+
@Index("idx_sla_approval_request_id", ["request_id"])
|
|
11
|
+
@Index("idx_sla_approval_source_approval_id", ["source_approval_id"])
|
|
12
|
+
@Index("idx_sla_approval_service_subservice", ["service_id", "sub_service_id"])
|
|
13
|
+
@Index("idx_sla_approval_approval_status", ["approval_status"])
|
|
14
|
+
@Index("idx_sla_approval_level", ["level"])
|
|
15
|
+
@Index("idx_sla_approval_approver_user_id", ["approver_user_id"])
|
|
16
|
+
@Index("idx_sla_approval_request_level", ["request_id", "level"])
|
|
17
|
+
@Index("idx_sla_approval_svc_sub_status", ["service_id", "sub_service_id", "approval_status"])
|
|
18
|
+
export class ServiceSlaApproval extends BaseModel {
|
|
19
|
+
@Column({ type: "int" })
|
|
20
|
+
request_id: number;
|
|
21
|
+
|
|
22
|
+
@Column({ type: "int" })
|
|
23
|
+
source_approval_id: number;
|
|
24
|
+
|
|
25
|
+
@Column({ type: "int", nullable: true })
|
|
26
|
+
service_id: number | null;
|
|
27
|
+
|
|
28
|
+
@Column({ type: "int", nullable: true })
|
|
29
|
+
sub_service_id: number | null;
|
|
30
|
+
|
|
31
|
+
@Column({ type: "varchar", length: 64 })
|
|
32
|
+
approval_status: string;
|
|
33
|
+
|
|
34
|
+
@Column({ type: "int" })
|
|
35
|
+
level: number;
|
|
36
|
+
|
|
37
|
+
@Column({ type: "int", nullable: true })
|
|
38
|
+
approver_user_id: number | null;
|
|
39
|
+
|
|
40
|
+
@Column({ type: "int", nullable: true })
|
|
41
|
+
approver_role_id: number | null;
|
|
42
|
+
|
|
43
|
+
@Column({ type: "int", nullable: true })
|
|
44
|
+
department_id: number | null;
|
|
45
|
+
|
|
46
|
+
@Column({ type: "int", nullable: true })
|
|
47
|
+
section_id: number | null;
|
|
48
|
+
|
|
49
|
+
/** Mirrors native approval `delegate_user_id` (IT master tables may use `delegation_user_id`). */
|
|
50
|
+
@Column({ type: "int", nullable: true })
|
|
51
|
+
delegate_user_id: number | null;
|
|
52
|
+
|
|
53
|
+
/** Mirrors native approval `approved_by` (acting user when status was last resolved). */
|
|
54
|
+
@Column({ type: "int", nullable: true })
|
|
55
|
+
approved_by: number | null;
|
|
56
|
+
|
|
57
|
+
/** Mirrors native approval comment / rejection reason. */
|
|
58
|
+
@Column({ type: "varchar", length: 255, nullable: true })
|
|
59
|
+
comment: string | null;
|
|
60
|
+
|
|
61
|
+
constructor() {
|
|
62
|
+
super();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -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
|
+
}
|