@platform-modules/civil-aviation-authority 2.3.311 → 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.
Files changed (64) hide show
  1. package/dist/models/DocumentMetadataModel.d.ts +45 -0
  2. package/dist/models/DocumentMetadataModel.js +171 -0
  3. package/dist/models/DocumentationDepartmentsModel.d.ts +13 -0
  4. package/dist/models/DocumentationDepartmentsModel.js +53 -0
  5. package/dist/models/FolderModel.d.ts +16 -0
  6. package/dist/models/FolderModel.js +85 -0
  7. package/dist/models/ImportExportMaterialModels.d.ts +92 -0
  8. package/dist/models/ImportExportMaterialModels.js +307 -0
  9. package/dist/models/PermissionModel.d.ts +18 -0
  10. package/dist/models/PermissionModel.js +68 -0
  11. package/dist/models/SecurityAccessApprovalModel.d.ts +23 -0
  12. package/dist/models/SecurityAccessApprovalModel.js +82 -0
  13. package/dist/models/SecurityAccessAttachmentModel.d.ts +12 -0
  14. package/dist/models/SecurityAccessAttachmentModel.js +56 -0
  15. package/dist/models/SecurityAccessChatModel.d.ts +12 -0
  16. package/dist/models/SecurityAccessChatModel.js +56 -0
  17. package/dist/models/SecurityAccessRequestModel.d.ts +25 -0
  18. package/dist/models/SecurityAccessRequestModel.js +80 -0
  19. package/dist/models/SecurityAccessWorkflowModel.d.ts +24 -0
  20. package/dist/models/SecurityAccessWorkflowModel.js +84 -0
  21. package/dist/models/ServiceExtensionAfterAge60Models.d.ts +93 -0
  22. package/dist/models/ServiceExtensionAfterAge60Models.js +312 -0
  23. package/dist/models/SlaApprovalsViewModel.js +54 -47
  24. package/dist/models/SlaMyRequestsViewModel.d.ts +3 -0
  25. package/dist/models/SlaMyRequestsViewModel.js +22 -2
  26. package/dist/models/UUIDBaseModel.d.ts +14 -0
  27. package/dist/models/UUIDBaseModel.js +66 -0
  28. package/dist/models/WorkingHoursExtensionModels.d.ts +88 -0
  29. package/dist/models/WorkingHoursExtensionModels.js +295 -0
  30. package/package.json +1 -1
  31. package/scripts/sync-sla-reports-sql.js +92 -92
  32. package/sql/README.md +21 -21
  33. package/sql/sla_reports_admin_procedures.sql +323 -323
  34. package/sql/sla_reports_approvals_workbook.sql +430 -430
  35. package/sql/sla_reports_procedures.sql +886 -886
  36. package/sql/vw_sla_approvals.sql +115 -108
  37. package/sql/vw_sla_my_requests.sql +58 -53
  38. package/src/models/AccessCardRequestModel.ts +135 -135
  39. package/src/models/AirportEntryPermitModel.ts +276 -276
  40. package/src/models/AnnualTrainingPlanRequestModel.ts +153 -153
  41. package/src/models/DocumentDriveModel.ts +28 -28
  42. package/src/models/DocumentFolderModel.ts +45 -45
  43. package/src/models/HotelApprovalModel.ts +83 -83
  44. package/src/models/HousingContractCancelApprovalModel.ts +64 -64
  45. package/src/models/HousingContractRenewalApprovalModel.ts +64 -64
  46. package/src/models/ITRequestAttachmentModel.ts +73 -73
  47. package/src/models/ItApprovalsModel.ts +84 -84
  48. package/src/models/LegalConsultationApprovalModel.ts +65 -65
  49. package/src/models/MissionTravelPassportExpiryNotificationConfigModel.ts +36 -36
  50. package/src/models/NotificationModel.ts +89 -89
  51. package/src/models/ResidentialUnitRentalApprovalModel.ts +143 -143
  52. package/src/models/ServiceExtensionAfter60ApprovalModel.ts +87 -87
  53. package/src/models/ServiceSlaApprovalModel.ts +64 -64
  54. package/src/models/ServicesNotificationConfigModel.ts +55 -55
  55. package/src/models/SlaApprovalsViewModel.ts +142 -135
  56. package/src/models/SlaMyRequestsViewModel.ts +21 -1
  57. package/src/models/StudyLeaveRequestModel.ts +144 -144
  58. package/src/models/TrainingRequestModel.ts +164 -164
  59. package/src/models/TrainingRoomBookingRequestModel.ts +142 -142
  60. package/src/models/TrainingRoomNotificationConfigModel.ts +30 -30
  61. package/src/models/role.ts +34 -34
  62. package/src/sla/sla-table-sync.service.ts +90 -90
  63. package/dist/helpers/cancellation-bilingual-persist.helper.d.ts +0 -37
  64. package/dist/helpers/cancellation-bilingual-persist.helper.js +0 -77
@@ -1,108 +1,115 @@
1
- -- SLA approvals read model: joined display names for approval routing.
2
-
3
- -- Approver-scope filtering is applied in Reports_Service (TypeORM), not in this view.
4
-
5
- -- Run once against the EmpPortal PostgreSQL database:
6
-
7
- -- psql -U <user> -d <database> -f sql/vw_sla_approvals.sql
8
-
9
-
10
-
11
- DROP VIEW IF EXISTS vw_sla_approvals CASCADE;
12
-
13
-
14
-
15
- CREATE VIEW vw_sla_approvals AS
16
-
17
- SELECT
18
-
19
- sa.id AS sla_approval_id,
20
-
21
- sa.source_approval_id,
22
-
23
- sa.request_id,
24
-
25
- sa.service_id AS service_id,
26
-
27
- sa.sub_service_id AS sub_service_id,
28
-
29
- TRIM(COALESCE(svc.name, ''))::TEXT AS service_name,
30
-
31
- TRIM(COALESCE(subsvc.sub_service_name, ''))::TEXT AS sub_service_name,
32
-
33
- sa.approver_role_id AS approval_role_id,
34
-
35
- TRIM(COALESCE(ar.name, ''))::TEXT AS approval_role_name,
36
-
37
- sa.department_id AS approval_department_id,
38
-
39
- TRIM(COALESCE(adpt.department_name, ''))::TEXT AS approval_department_name,
40
-
41
- sa.section_id AS approval_section_id,
42
-
43
- TRIM(COALESCE(asec.section_name, ''))::TEXT AS approval_section_name,
44
-
45
- sa.approval_status::TEXT AS approval_status,
46
-
47
- sr.status::TEXT AS request_status,
48
-
49
- sa.level AS level,
50
-
51
- sa.approver_user_id AS approver_user_id,
52
-
53
- TRIM(COALESCE(au.employee_name, ''))::TEXT AS approver_user_name,
54
-
55
- sa.delegate_user_id AS delegate_user_id,
56
-
57
- TRIM(COALESCE(du.employee_name, ''))::TEXT AS delegate_user_name,
58
-
59
- sa.approved_by AS approved_by,
60
-
61
- TRIM(COALESCE(ab.employee_name, ''))::TEXT AS approved_by_name,
62
-
63
- sa.comment::TEXT AS comment,
64
-
65
- sa.created_at AS created_at,
66
-
67
- sa.updated_at AS updated_at
68
-
69
- FROM sla_approval sa
70
-
71
- INNER JOIN sla_requests sr
72
-
73
- ON sr.request_id = sa.request_id AND COALESCE(sr.is_deleted, false) = false
74
-
75
- LEFT JOIN caa_services svc
76
-
77
- ON svc.id = sa.service_id AND COALESCE(svc.is_deleted, false) = false
78
-
79
- LEFT JOIN caa_sub_services subsvc
80
-
81
- ON subsvc.id = sa.sub_service_id AND COALESCE(subsvc.is_deleted, false) = false
82
-
83
- LEFT JOIN departments adpt
84
-
85
- ON adpt.id = sa.department_id AND COALESCE(adpt.is_deleted, false) = false
86
-
87
- LEFT JOIN sections asec
88
-
89
- ON asec.id = sa.section_id AND COALESCE(asec.is_deleted, false) = false
90
-
91
- LEFT JOIN role ar
92
-
93
- ON ar.id = sa.approver_role_id AND COALESCE(ar.is_deleted, false) = false
94
-
95
- LEFT JOIN users au
96
-
97
- ON au.id = sa.approver_user_id AND COALESCE(au.is_deleted, false) = false
98
-
99
- LEFT JOIN users du
100
-
101
- ON du.id = sa.delegate_user_id AND COALESCE(du.is_deleted, false) = false
102
-
103
- LEFT JOIN users ab
104
-
105
- ON ab.id = sa.approved_by AND COALESCE(ab.is_deleted, false) = false
106
-
107
- WHERE COALESCE(sa.is_deleted, false) = false;
108
-
1
+ -- SLA approvals read model: joined display names for approval routing.
2
+
3
+ -- Approver-scope filtering is applied in Reports_Service (TypeORM), not in this view.
4
+
5
+ -- Run once against the EmpPortal PostgreSQL database:
6
+
7
+ -- psql -U <user> -d <database> -f sql/vw_sla_approvals.sql
8
+
9
+
10
+
11
+ DROP VIEW IF EXISTS vw_sla_approvals CASCADE;
12
+
13
+
14
+
15
+ CREATE VIEW vw_sla_approvals AS
16
+
17
+ SELECT
18
+
19
+ sa.id AS sla_approval_id,
20
+
21
+ sa.source_approval_id,
22
+
23
+ sa.request_id,
24
+
25
+ sa.service_id AS service_id,
26
+
27
+ sa.sub_service_id AS sub_service_id,
28
+
29
+ TRIM(COALESCE(svc.name, ''))::TEXT AS service_name,
30
+
31
+ TRIM(COALESCE(subsvc.sub_service_name, ''))::TEXT AS sub_service_name,
32
+
33
+ sa.approver_role_id AS approval_role_id,
34
+
35
+ TRIM(COALESCE(ar.name, ''))::TEXT AS approval_role_name,
36
+
37
+ sa.department_id AS approval_department_id,
38
+
39
+ TRIM(COALESCE(adpt.department_name, ''))::TEXT AS approval_department_name,
40
+
41
+ sa.section_id AS approval_section_id,
42
+
43
+ TRIM(COALESCE(asec.section_name, ''))::TEXT AS approval_section_name,
44
+
45
+ sa.approval_status::TEXT AS approval_status,
46
+
47
+ sr.status::TEXT AS request_status,
48
+
49
+ sa.level AS level,
50
+
51
+ sa.approver_user_id AS approver_user_id,
52
+
53
+ TRIM(COALESCE(au.employee_name, ''))::TEXT AS approver_user_name,
54
+
55
+ sa.delegate_user_id AS delegate_user_id,
56
+
57
+ TRIM(COALESCE(du.employee_name, ''))::TEXT AS delegate_user_name,
58
+
59
+ sa.approved_by AS approved_by,
60
+
61
+ TRIM(COALESCE(ab.employee_name, ''))::TEXT AS approved_by_name,
62
+
63
+ sa.comment::TEXT AS comment,
64
+
65
+ sa.created_at AS created_at,
66
+
67
+ sa.updated_at AS updated_at
68
+
69
+ FROM sla_approval sa
70
+
71
+ INNER JOIN sla_requests sr
72
+
73
+ ON sr.id = (
74
+ SELECT MIN(sr2.id)
75
+ FROM sla_requests sr2
76
+ WHERE sr2.request_id = sa.request_id
77
+ AND COALESCE(sr2.is_deleted, false) = false
78
+ AND (sa.service_id IS NULL OR sr2.service_id = sa.service_id)
79
+ AND (sa.sub_service_id IS NULL OR sr2.sub_service_id = sa.sub_service_id)
80
+ )
81
+
82
+ LEFT JOIN caa_services svc
83
+
84
+ ON svc.id = sa.service_id AND COALESCE(svc.is_deleted, false) = false
85
+
86
+ LEFT JOIN caa_sub_services subsvc
87
+
88
+ ON subsvc.id = sa.sub_service_id AND COALESCE(subsvc.is_deleted, false) = false
89
+
90
+ LEFT JOIN departments adpt
91
+
92
+ ON adpt.id = sa.department_id AND COALESCE(adpt.is_deleted, false) = false
93
+
94
+ LEFT JOIN sections asec
95
+
96
+ ON asec.id = sa.section_id AND COALESCE(asec.is_deleted, false) = false
97
+
98
+ LEFT JOIN role ar
99
+
100
+ ON ar.id = sa.approver_role_id AND COALESCE(ar.is_deleted, false) = false
101
+
102
+ LEFT JOIN users au
103
+
104
+ ON au.id = sa.approver_user_id AND COALESCE(au.is_deleted, false) = false
105
+
106
+ LEFT JOIN users du
107
+
108
+ ON du.id = sa.delegate_user_id AND COALESCE(du.is_deleted, false) = false
109
+
110
+ LEFT JOIN users ab
111
+
112
+ ON ab.id = sa.approved_by AND COALESCE(ab.is_deleted, false) = false
113
+
114
+ WHERE COALESCE(sa.is_deleted, false) = false;
115
+
@@ -1,53 +1,58 @@
1
- -- SLA "my requests" read model: joined display names + filtered request_obj payload.
2
- -- Applied via: npm run sync:sla-sql (shared_models)
3
-
4
- CREATE OR REPLACE VIEW vw_sla_my_requests AS
5
- SELECT
6
- sr.id AS sla_request_id,
7
- sr.user_id,
8
- sr.service_id AS service_id,
9
- sr.sub_service_id AS sub_service_id,
10
- TRIM(COALESCE(creator.employee_name, ''))::TEXT AS created_by,
11
- sr.created_at,
12
- TRIM(COALESCE(dept.department_name, ''))::TEXT AS req_user_department_id,
13
- TRIM(COALESCE(sec.section_name, ''))::TEXT AS req_user_section_id,
14
- TRIM(COALESCE(svc.name, ''))::TEXT AS service_name,
15
- TRIM(COALESCE(subsvc.sub_service_name, ''))::TEXT AS sub_service_name,
16
- sr.status::TEXT AS status,
17
- sr.request_id,
18
- (
19
- COALESCE(sr.request_obj, '{}'::jsonb)
20
- - 'id'
21
- - 'status'
22
- - 'role_id'
23
- - 'user_id'
24
- - 'createdBy'
25
- - 'created_at'
26
- - 'updated_by'
27
- - 'updated_at'
28
- - 'req_user_department_id'
29
- - 'workflow_execution_id'
30
- - 'department_id'
31
- - 'req_user_section_id'
32
- - 'service_type_id'
33
- - 'service_type'
34
- - 'created_by'
35
- - 'service_id'
36
- - 'sub_service_id'
37
- - 'attachments'
38
- - 'is_deleted'
39
- - 'sla_request'
40
- - 'sla_request_id'
41
- ) AS request_fields
42
- FROM sla_requests sr
43
- LEFT JOIN users creator
44
- ON creator.id = sr.created_by AND COALESCE(creator.is_deleted, false) = false
45
- LEFT JOIN departments dept
46
- ON dept.id = sr.req_user_department_id AND COALESCE(dept.is_deleted, false) = false
47
- LEFT JOIN sections sec
48
- ON sec.id = sr.req_user_section_id AND COALESCE(sec.is_deleted, false) = false
49
- LEFT JOIN caa_services svc
50
- ON svc.id = sr.service_id AND COALESCE(svc.is_deleted, false) = false
51
- LEFT JOIN caa_sub_services subsvc
52
- ON subsvc.id = sr.sub_service_id AND COALESCE(subsvc.is_deleted, false) = false
53
- WHERE COALESCE(sr.is_deleted, false) = false;
1
+ -- SLA "my requests" read model: joined display names + filtered request_obj payload.
2
+ -- Applied via: npm run sync:sla-sql (shared_models)
3
+
4
+ CREATE OR REPLACE VIEW vw_sla_my_requests AS
5
+ SELECT
6
+ sr.id AS sla_request_id,
7
+ sr.user_id,
8
+ sr.service_id AS service_id,
9
+ sr.sub_service_id AS sub_service_id,
10
+ TRIM(COALESCE(creator.employee_name, ''))::TEXT AS created_by,
11
+ sr.created_at,
12
+ TRIM(COALESCE(dept.department_name, ''))::TEXT AS req_user_department_id,
13
+ TRIM(COALESCE(sec.section_name, ''))::TEXT AS req_user_section_id,
14
+ TRIM(COALESCE(svc.name, ''))::TEXT AS service_name,
15
+ TRIM(COALESCE(subsvc.sub_service_name, ''))::TEXT AS sub_service_name,
16
+ sr.status::TEXT AS status,
17
+ sr.request_id,
18
+ (
19
+ COALESCE(sr.request_obj, '{}'::jsonb)
20
+ - 'id'
21
+ - 'status'
22
+ - 'role_id'
23
+ - 'user_id'
24
+ - 'createdBy'
25
+ - 'created_at'
26
+ - 'updated_by'
27
+ - 'updated_at'
28
+ - 'req_user_department_id'
29
+ - 'workflow_execution_id'
30
+ - 'department_id'
31
+ - 'req_user_section_id'
32
+ - 'service_type_id'
33
+ - 'service_type'
34
+ - 'created_by'
35
+ - 'service_id'
36
+ - 'sub_service_id'
37
+ - 'attachments'
38
+ - 'is_deleted'
39
+ - 'sla_request'
40
+ - 'sla_request_id'
41
+ ) AS request_fields,
42
+ TRIM(COALESCE(req_owner.employee_arabic_name, ''))::TEXT AS req_user_arabicname,
43
+ TRIM(COALESCE(dept.department_arabic_name, ''))::TEXT AS req_user_department_arabicname,
44
+ TRIM(COALESCE(sec.section_arabic_name, ''))::TEXT AS req_user_section_arabicname
45
+ FROM sla_requests sr
46
+ LEFT JOIN users req_owner
47
+ ON req_owner.id = sr.user_id AND COALESCE(req_owner.is_deleted, false) = false
48
+ LEFT JOIN users creator
49
+ ON creator.id = sr.created_by AND COALESCE(creator.is_deleted, false) = false
50
+ LEFT JOIN departments dept
51
+ ON dept.id = sr.req_user_department_id AND COALESCE(dept.is_deleted, false) = false
52
+ LEFT JOIN sections sec
53
+ ON sec.id = sr.req_user_section_id AND COALESCE(sec.is_deleted, false) = false
54
+ LEFT JOIN caa_services svc
55
+ ON svc.id = sr.service_id AND COALESCE(svc.is_deleted, false) = false
56
+ LEFT JOIN caa_sub_services subsvc
57
+ ON subsvc.id = sr.sub_service_id AND COALESCE(subsvc.is_deleted, false) = false
58
+ WHERE COALESCE(sr.is_deleted, false) = false;
@@ -1,135 +1,135 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from "./BaseModel";
3
-
4
- export enum AccessCardRequestFor {
5
- SELF = "Self",
6
- BEHALF = "Behalf"
7
- }
8
-
9
- export enum AccessCardRequestType {
10
- NEW = "New",
11
- RENEWAL = "Renewal"
12
- }
13
-
14
- export enum AccessCardCategory {
15
- TRAINEE = "Trainee",
16
- WORKER = "Workers",
17
- EMPLOYEE = "Employees",
18
- CONTRACTOR = "Contractors"
19
- }
20
-
21
- export enum AccessCardRequestStatus {
22
- PENDING = "Pending",
23
- IN_PROGRESS = "In Progress",
24
- APPROVED = "Approved",
25
- REJECTED = "Rejected"
26
- }
27
-
28
- @Entity({ name: "access_card_requests" })
29
- export class AccessCardRequest extends BaseModel {
30
- @Column({ type: "int", nullable: true })
31
- req_user_department_id: number | null;
32
-
33
- @Column({ type: "int", nullable: true })
34
- req_user_section_id: number | null;
35
-
36
- @Column({ type: "int", nullable: true })
37
- service_id: number | null;
38
-
39
- @Column({ type: "int", nullable: true })
40
- sub_service_id: number | null;
41
-
42
- @Column({ type: "int", nullable: false })
43
- user_id: number;
44
-
45
- @Column({ type: "enum", enum: AccessCardRequestFor, nullable: false })
46
- request_for: AccessCardRequestFor;
47
-
48
- @Column({ type: "varchar", length: 255, nullable: false })
49
- name: string;
50
-
51
- @Column({ type: "varchar", length: 100, nullable: false })
52
- id_number: string;
53
-
54
- @Column({ type: "varchar", length: 50, nullable: false })
55
- phone_number: string;
56
-
57
- @Column({ type: "varchar", length: 255, nullable: false })
58
- email_id: string;
59
-
60
- @Column({ type: "enum", enum: AccessCardRequestType, nullable: false })
61
- request_type: AccessCardRequestType;
62
-
63
- @Column({ type: "enum", enum: AccessCardCategory, nullable: false })
64
- category: AccessCardCategory;
65
-
66
- @Column({ type: "varchar", length: 50, nullable: true })
67
- approval_route: string | null;
68
-
69
- @Column({ type: "varchar", length: 255, nullable: true })
70
- organization: string | null;
71
-
72
- @Column({ type: "varchar", length: 100, nullable: true })
73
- access_card_no: string | null;
74
-
75
- @Column({ type: "text", nullable: false })
76
- reason: string;
77
-
78
- @Column({ type: "date", nullable: true })
79
- request_date: Date;
80
-
81
- @Column({
82
- type: "enum",
83
- enum: AccessCardRequestStatus,
84
- default: AccessCardRequestStatus.PENDING,
85
- nullable: false
86
- })
87
- status: AccessCardRequestStatus;
88
-
89
- @Column({ type: "varchar", length: 255, nullable: true })
90
- workflow_execution_id: string | null;
91
-
92
- constructor(
93
- request_for: AccessCardRequestFor,
94
- name: string,
95
- id_number: string,
96
- phone_number: string,
97
- email_id: string,
98
- request_type: AccessCardRequestType,
99
- category: AccessCardCategory,
100
- organization: string | null,
101
- reason: string,
102
- request_date: Date,
103
- user_id: number,
104
- status: AccessCardRequestStatus = AccessCardRequestStatus.PENDING,
105
- approval_route?: string | null,
106
- service_id?: number,
107
- sub_service_id?: number,
108
- req_user_department_id?: number,
109
- req_user_section_id?: number,
110
- access_card_no?: string | null,
111
- workflow_execution_id?: string | null
112
- ) {
113
- super();
114
- this.request_for = request_for;
115
- this.name = name;
116
- this.id_number = id_number;
117
- this.phone_number = phone_number;
118
- this.email_id = email_id;
119
- this.request_type = request_type;
120
- this.category = category;
121
- this.organization = organization ?? null;
122
- this.reason = reason;
123
- this.request_date = request_date;
124
- this.user_id = user_id;
125
- this.status = status;
126
- this.approval_route = approval_route ?? null;
127
- this.service_id = service_id ?? null;
128
- this.sub_service_id = sub_service_id ?? null;
129
- this.req_user_department_id = req_user_department_id ?? null;
130
- this.req_user_section_id = req_user_section_id ?? null;
131
- this.access_card_no = access_card_no ?? null;
132
- this.workflow_execution_id = workflow_execution_id ?? null;
133
- }
134
- }
135
-
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+
4
+ export enum AccessCardRequestFor {
5
+ SELF = "Self",
6
+ BEHALF = "Behalf"
7
+ }
8
+
9
+ export enum AccessCardRequestType {
10
+ NEW = "New",
11
+ RENEWAL = "Renewal"
12
+ }
13
+
14
+ export enum AccessCardCategory {
15
+ TRAINEE = "Trainee",
16
+ WORKER = "Workers",
17
+ EMPLOYEE = "Employees",
18
+ CONTRACTOR = "Contractors"
19
+ }
20
+
21
+ export enum AccessCardRequestStatus {
22
+ PENDING = "Pending",
23
+ IN_PROGRESS = "In Progress",
24
+ APPROVED = "Approved",
25
+ REJECTED = "Rejected"
26
+ }
27
+
28
+ @Entity({ name: "access_card_requests" })
29
+ export class AccessCardRequest extends BaseModel {
30
+ @Column({ type: "int", nullable: true })
31
+ req_user_department_id: number | null;
32
+
33
+ @Column({ type: "int", nullable: true })
34
+ req_user_section_id: number | null;
35
+
36
+ @Column({ type: "int", nullable: true })
37
+ service_id: number | null;
38
+
39
+ @Column({ type: "int", nullable: true })
40
+ sub_service_id: number | null;
41
+
42
+ @Column({ type: "int", nullable: false })
43
+ user_id: number;
44
+
45
+ @Column({ type: "enum", enum: AccessCardRequestFor, nullable: false })
46
+ request_for: AccessCardRequestFor;
47
+
48
+ @Column({ type: "varchar", length: 255, nullable: false })
49
+ name: string;
50
+
51
+ @Column({ type: "varchar", length: 100, nullable: false })
52
+ id_number: string;
53
+
54
+ @Column({ type: "varchar", length: 50, nullable: false })
55
+ phone_number: string;
56
+
57
+ @Column({ type: "varchar", length: 255, nullable: false })
58
+ email_id: string;
59
+
60
+ @Column({ type: "enum", enum: AccessCardRequestType, nullable: false })
61
+ request_type: AccessCardRequestType;
62
+
63
+ @Column({ type: "enum", enum: AccessCardCategory, nullable: false })
64
+ category: AccessCardCategory;
65
+
66
+ @Column({ type: "varchar", length: 50, nullable: true })
67
+ approval_route: string | null;
68
+
69
+ @Column({ type: "varchar", length: 255, nullable: true })
70
+ organization: string | null;
71
+
72
+ @Column({ type: "varchar", length: 100, nullable: true })
73
+ access_card_no: string | null;
74
+
75
+ @Column({ type: "text", nullable: false })
76
+ reason: string;
77
+
78
+ @Column({ type: "date", nullable: true })
79
+ request_date: Date;
80
+
81
+ @Column({
82
+ type: "enum",
83
+ enum: AccessCardRequestStatus,
84
+ default: AccessCardRequestStatus.PENDING,
85
+ nullable: false
86
+ })
87
+ status: AccessCardRequestStatus;
88
+
89
+ @Column({ type: "varchar", length: 255, nullable: true })
90
+ workflow_execution_id: string | null;
91
+
92
+ constructor(
93
+ request_for: AccessCardRequestFor,
94
+ name: string,
95
+ id_number: string,
96
+ phone_number: string,
97
+ email_id: string,
98
+ request_type: AccessCardRequestType,
99
+ category: AccessCardCategory,
100
+ organization: string | null,
101
+ reason: string,
102
+ request_date: Date,
103
+ user_id: number,
104
+ status: AccessCardRequestStatus = AccessCardRequestStatus.PENDING,
105
+ approval_route?: string | null,
106
+ service_id?: number,
107
+ sub_service_id?: number,
108
+ req_user_department_id?: number,
109
+ req_user_section_id?: number,
110
+ access_card_no?: string | null,
111
+ workflow_execution_id?: string | null
112
+ ) {
113
+ super();
114
+ this.request_for = request_for;
115
+ this.name = name;
116
+ this.id_number = id_number;
117
+ this.phone_number = phone_number;
118
+ this.email_id = email_id;
119
+ this.request_type = request_type;
120
+ this.category = category;
121
+ this.organization = organization ?? null;
122
+ this.reason = reason;
123
+ this.request_date = request_date;
124
+ this.user_id = user_id;
125
+ this.status = status;
126
+ this.approval_route = approval_route ?? null;
127
+ this.service_id = service_id ?? null;
128
+ this.sub_service_id = sub_service_id ?? null;
129
+ this.req_user_department_id = req_user_department_id ?? null;
130
+ this.req_user_section_id = req_user_section_id ?? null;
131
+ this.access_card_no = access_card_no ?? null;
132
+ this.workflow_execution_id = workflow_execution_id ?? null;
133
+ }
134
+ }
135
+