@platform-modules/foreign-ministry 1.2.19 → 1.2.20

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 (70) hide show
  1. package/.env +3 -17
  2. package/dist/data-source.js +11 -1
  3. package/dist/index.d.ts +6 -0
  4. package/dist/index.js +6 -0
  5. package/dist/models/DiplomaticClubCardApprovalModel.d.ts +16 -0
  6. package/dist/models/DiplomaticClubCardApprovalModel.js +58 -0
  7. package/dist/models/DiplomaticClubCardAttachmentModel.d.ts +9 -0
  8. package/dist/models/DiplomaticClubCardAttachmentModel.js +44 -0
  9. package/dist/models/DiplomaticClubCardChatModel.d.ts +7 -0
  10. package/dist/models/{HelpContentMappedCategoriesModel.js → DiplomaticClubCardChatModel.js} +18 -16
  11. package/dist/models/DiplomaticClubCardMemberModel.d.ts +13 -0
  12. package/dist/models/DiplomaticClubCardMemberModel.js +60 -0
  13. package/dist/models/DiplomaticClubCardRequestModel.d.ts +33 -0
  14. package/dist/models/DiplomaticClubCardRequestModel.js +98 -0
  15. package/dist/models/DiplomaticClubCardWorkFlowModel.d.ts +12 -0
  16. package/dist/models/DiplomaticClubCardWorkFlowModel.js +42 -0
  17. package/dist/models/DiplomaticServiceDetailsModel.d.ts +20 -0
  18. package/dist/models/DiplomaticServiceDetailsModel.js +65 -0
  19. package/dist/models/DiplomaticSettingsModel.d.ts +11 -0
  20. package/dist/models/DiplomaticSettingsModel.js +59 -0
  21. package/dist/models/DiplomaticTitleModel.d.ts +12 -0
  22. package/dist/models/DiplomaticTitleModel.js +45 -0
  23. package/dist/models/EmployeeCardApprovalsModel.d.ts +31 -0
  24. package/dist/models/EmployeeCardApprovalsModel.js +100 -0
  25. package/dist/models/EmployeeCardAttachmentsModel.d.ts +17 -0
  26. package/dist/models/EmployeeCardAttachmentsModel.js +69 -0
  27. package/dist/models/EmployeeCardChatsModel.d.ts +19 -0
  28. package/dist/models/EmployeeCardChatsModel.js +79 -0
  29. package/dist/models/EmployeeCardRequestsModel.d.ts +40 -0
  30. package/dist/models/EmployeeCardRequestsModel.js +126 -0
  31. package/dist/models/EmployeeCardWorkFlowModel.d.ts +34 -0
  32. package/dist/models/EmployeeCardWorkFlowModel.js +103 -0
  33. package/dist/models/LeaveRequestModel.d.ts +1 -9
  34. package/dist/models/LeaveRequestModel.js +3 -28
  35. package/dist/models/PassportRequestApprovalModel.d.ts +22 -0
  36. package/dist/models/PassportRequestApprovalModel.js +91 -0
  37. package/dist/models/PassportRequestAttachmentModel.d.ts +10 -0
  38. package/dist/models/PassportRequestAttachmentModel.js +54 -0
  39. package/dist/models/PassportRequestChatModel.d.ts +8 -0
  40. package/dist/models/PassportRequestChatModel.js +44 -0
  41. package/dist/models/PassportRequestDependentModel.d.ts +20 -0
  42. package/dist/models/PassportRequestDependentModel.js +85 -0
  43. package/dist/models/PassportRequestModel.d.ts +40 -0
  44. package/dist/models/PassportRequestModel.js +128 -0
  45. package/dist/models/PassportRequestWorkFlowModel.d.ts +15 -0
  46. package/dist/models/PassportRequestWorkFlowModel.js +60 -0
  47. package/dist/models/SubscriptionAmountModel.d.ts +67 -0
  48. package/dist/models/SubscriptionAmountModel.js +114 -0
  49. package/dist/models/user.d.ts +1 -2
  50. package/dist/models/user.js +2 -7
  51. package/package.json +1 -1
  52. package/src/data-source.ts +11 -1
  53. package/src/index.ts +7 -1
  54. package/src/models/DiplomaticClubSubscriptionMasterModel.ts +26 -26
  55. package/src/models/DiplomaticRequestsModel.ts +154 -154
  56. package/src/models/EmployeeCardApprovalsModel.ts +87 -0
  57. package/src/models/EmployeeCardAttachmentsModel.ts +56 -0
  58. package/src/models/EmployeeCardChatsModel.ts +66 -0
  59. package/src/models/EmployeeCardRequestsModel.ts +115 -0
  60. package/src/models/EmployeeCardWorkFlowModel.ts +90 -0
  61. package/src/models/LeaveRequestModel.ts +1 -21
  62. package/src/models/user.ts +0 -5
  63. package/dist/models/HelpContentMappedCategoriesModel.d.ts +0 -6
  64. package/dist/models/HelpContentMappedTagsModel.d.ts +0 -6
  65. package/dist/models/HelpContentMappedTagsModel.js +0 -34
  66. package/dist/models/HelpContentTagsModel.d.ts +0 -5
  67. package/dist/models/HelpContentTagsModel.js +0 -29
  68. package/dist/models/questionTagsModel.d.ts +0 -6
  69. package/dist/models/questionTagsModel.js +0 -34
  70. /package/src/models/{LeaveConfigGradesModel.ts → LeaveConfigGradesModel.Ts} +0 -0
@@ -1,154 +1,154 @@
1
- import { Column, Entity, OneToOne, OneToMany, ManyToOne, JoinColumn } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
-
4
- // Import types only (not for runtime)
5
- import type { DiplomaticApprovals } from './DiplomaticApprovalsModel';
6
- import type { DiplomaticWorkFlow } from './DiplomaticWorkFlowModel';
7
- import type { DiplomaticAttachments } from './DiplomaticAttachmentsModel';
8
- import type { DiplomaticChats } from './DiplomaticChatsModel';
9
- import type { DiplomaticClubCardMembers } from './DiplomaticClubCardMembersModel';
10
-
11
- export enum DiplomaticRequestStatus {
12
- DRAFT = "Draft",
13
- SUBMITTED = "Submitted",
14
- PENDING = "Pending",
15
- IN_PROGRESS = "In Progress",
16
- APPROVED = "Approved",
17
- REJECTED = "Rejected",
18
- COMPLETED = "Completed",
19
- CANCELLED = "Cancelled"
20
- }
21
-
22
- @Entity({ name: 'diplomatic_requests' })
23
- export class DiplomaticRequests extends BaseModel {
24
- @Column({ type: 'int' })
25
- user_id: number;
26
-
27
- @Column({ type: 'varchar', length: 100 })
28
- employee_id: string;
29
-
30
- @Column({ type: 'varchar', length: 255 })
31
- employee_name: string;
32
-
33
- @Column({ type: 'varchar', length: 100, nullable: true })
34
- grade: string | null;
35
-
36
- @Column({ type: 'int', nullable: true })
37
- designation_id: number | null;
38
-
39
- @Column({ type: 'int', nullable: true })
40
- department_id: number | null;
41
-
42
- @Column({ type: 'varchar', length: 255 })
43
- email_address: string;
44
-
45
- @Column({ type: 'varchar', length: 20 })
46
- contact_number: string;
47
-
48
- @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
49
- request_date: Date;
50
-
51
- @Column({ type: 'enum', enum: DiplomaticRequestStatus, default: DiplomaticRequestStatus.PENDING })
52
- request_status: DiplomaticRequestStatus;
53
-
54
- @Column({ type: 'timestamp', nullable: true })
55
- request_close_date: Date | null;
56
-
57
- @Column({ type: 'date', nullable: true })
58
- end_date: Date | null;
59
-
60
- @Column({ type: 'text', nullable: true })
61
- remarks: string | null;
62
-
63
- @Column({ type: 'int', nullable: true })
64
- current_approval_level: number | null;
65
-
66
- @Column({ type: 'int', nullable: true })
67
- current_approver_id: number | null;
68
-
69
- @Column({ type: 'int', nullable: true })
70
- service_id: number | null;
71
-
72
- @Column({ type: 'int', nullable: true })
73
- sub_service_id: number | null;
74
-
75
- @Column({ type: 'varchar', length: 255, nullable: true })
76
- member_name: string | null;
77
-
78
- @Column({ type: 'varchar', length: 100, nullable: true })
79
- membership_type: string | null;
80
-
81
- @Column({ type: 'int', nullable: true })
82
- diplomatic_title_id: number | null;
83
-
84
- @Column({ type: 'varchar', length: 255, nullable: true })
85
- location: string | null;
86
-
87
- @Column({ type: 'varchar', length: 100, nullable: true })
88
- request_type: string | null;
89
-
90
- @Column({ type: 'date', nullable: true })
91
- expiry_date: Date | null;
92
-
93
- @Column({ type: 'varchar', length: 500, nullable: true })
94
- photo_url: string | null;
95
-
96
- @Column({ type: 'varchar', length: 100, nullable: true })
97
- membership_id: string | null;
98
-
99
- @Column({ type: 'varchar', length: 255, nullable: true })
100
- organization: string | null;
101
-
102
- @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
103
- subscription_amount: number | null;
104
-
105
- @Column({ type: 'int', nullable: true })
106
- section_id: number | null;
107
-
108
- @Column({ type: 'int', nullable: true })
109
- reporting_manager: number | null;
110
-
111
- @Column({ type: 'varchar', length: 255, nullable: true })
112
- workflow_execution_id: string | null;
113
-
114
- @OneToMany('DiplomaticClubCardMembers', 'diplomaticRequest', { nullable: true })
115
- diplomaticClubCardMembers?: DiplomaticClubCardMembers[];
116
-
117
- @OneToMany('DiplomaticApprovals', 'diplomaticRequest')
118
- approvals?: DiplomaticApprovals[];
119
-
120
- @OneToMany('DiplomaticWorkFlow', 'diplomaticRequest')
121
- workflows?: DiplomaticWorkFlow[];
122
-
123
- @OneToMany('DiplomaticAttachments', 'diplomaticRequest')
124
- attachments?: DiplomaticAttachments[];
125
-
126
- @OneToMany('DiplomaticChats', 'diplomaticRequest')
127
- chats?: DiplomaticChats[];
128
-
129
- constructor(
130
- user_id: number,
131
- employee_id: string,
132
- employee_name: string,
133
- email_address: string,
134
- contact_number: string,
135
- service_id: number | null,
136
- sub_service_id: number | null,
137
- section_id: number | null,
138
- reporting_manager: number | null
139
- ) {
140
- super();
141
- this.user_id = user_id;
142
- this.employee_id = employee_id;
143
- this.employee_name = employee_name;
144
- this.email_address = email_address;
145
- this.contact_number = contact_number;
146
- this.request_date = new Date();
147
- this.request_status = DiplomaticRequestStatus.PENDING;
148
- this.service_id = service_id;
149
- this.sub_service_id = sub_service_id;
150
- this.section_id = section_id;
151
- this.reporting_manager = reporting_manager;
152
- }
153
- }
154
-
1
+ import { Column, Entity, OneToOne, OneToMany, ManyToOne, JoinColumn } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ // Import types only (not for runtime)
5
+ import type { DiplomaticApprovals } from './DiplomaticApprovalsModel';
6
+ import type { DiplomaticWorkFlow } from './DiplomaticWorkFlowModel';
7
+ import type { DiplomaticAttachments } from './DiplomaticAttachmentsModel';
8
+ import type { DiplomaticChats } from './DiplomaticChatsModel';
9
+ import type { DiplomaticClubCardMembers } from './DiplomaticClubCardMembersModel';
10
+
11
+ export enum DiplomaticRequestStatus {
12
+ DRAFT = "Draft",
13
+ SUBMITTED = "Submitted",
14
+ PENDING = "Pending",
15
+ IN_PROGRESS = "In Progress",
16
+ APPROVED = "Approved",
17
+ REJECTED = "Rejected",
18
+ COMPLETED = "Completed",
19
+ CANCELLED = "Cancelled"
20
+ }
21
+
22
+ @Entity({ name: 'diplomatic_requests' })
23
+ export class DiplomaticRequests extends BaseModel {
24
+ @Column({ type: 'int' })
25
+ user_id: number;
26
+
27
+ @Column({ type: 'varchar', length: 100 })
28
+ employee_id: string;
29
+
30
+ @Column({ type: 'varchar', length: 255 })
31
+ employee_name: string;
32
+
33
+ @Column({ type: 'varchar', length: 100, nullable: true })
34
+ grade: string | null;
35
+
36
+ @Column({ type: 'int', nullable: true })
37
+ designation_id: number | null;
38
+
39
+ @Column({ type: 'int', nullable: true })
40
+ department_id: number | null;
41
+
42
+ @Column({ type: 'varchar', length: 255 })
43
+ email_address: string;
44
+
45
+ @Column({ type: 'varchar', length: 20 })
46
+ contact_number: string;
47
+
48
+ @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
49
+ request_date: Date;
50
+
51
+ @Column({ type: 'enum', enum: DiplomaticRequestStatus, default: DiplomaticRequestStatus.PENDING })
52
+ request_status: DiplomaticRequestStatus;
53
+
54
+ @Column({ type: 'timestamp', nullable: true })
55
+ request_close_date: Date | null;
56
+
57
+ @Column({ type: 'date', nullable: true })
58
+ end_date: Date | null;
59
+
60
+ @Column({ type: 'text', nullable: true })
61
+ remarks: string | null;
62
+
63
+ @Column({ type: 'int', nullable: true })
64
+ current_approval_level: number | null;
65
+
66
+ @Column({ type: 'int', nullable: true })
67
+ current_approver_id: number | null;
68
+
69
+ @Column({ type: 'int', nullable: true })
70
+ service_id: number | null;
71
+
72
+ @Column({ type: 'int', nullable: true })
73
+ sub_service_id: number | null;
74
+
75
+ @Column({ type: 'varchar', length: 255, nullable: true })
76
+ member_name: string | null;
77
+
78
+ @Column({ type: 'varchar', length: 100, nullable: true })
79
+ membership_type: string | null;
80
+
81
+ @Column({ type: 'int', nullable: true })
82
+ diplomatic_title_id: number | null;
83
+
84
+ @Column({ type: 'varchar', length: 255, nullable: true })
85
+ location: string | null;
86
+
87
+ @Column({ type: 'varchar', length: 100, nullable: true })
88
+ request_type: string | null;
89
+
90
+ @Column({ type: 'date', nullable: true })
91
+ expiry_date: Date | null;
92
+
93
+ @Column({ type: 'varchar', length: 500, nullable: true })
94
+ photo_url: string | null;
95
+
96
+ @Column({ type: 'varchar', length: 100, nullable: true })
97
+ membership_id: string | null;
98
+
99
+ @Column({ type: 'varchar', length: 255, nullable: true })
100
+ organization: string | null;
101
+
102
+ @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
103
+ subscription_amount: number | null;
104
+
105
+ @Column({ type: 'int', nullable: true })
106
+ section_id: number | null;
107
+
108
+ @Column({ type: 'int', nullable: true })
109
+ reporting_manager: number | null;
110
+
111
+ @Column({ type: 'varchar', length: 255, nullable: true })
112
+ workflow_execution_id: string | null;
113
+
114
+ @OneToMany('DiplomaticClubCardMembers', 'diplomaticRequest', { nullable: true })
115
+ diplomaticClubCardMembers?: DiplomaticClubCardMembers[];
116
+
117
+ @OneToMany('DiplomaticApprovals', 'diplomaticRequest')
118
+ approvals?: DiplomaticApprovals[];
119
+
120
+ @OneToMany('DiplomaticWorkFlow', 'diplomaticRequest')
121
+ workflows?: DiplomaticWorkFlow[];
122
+
123
+ @OneToMany('DiplomaticAttachments', 'diplomaticRequest')
124
+ attachments?: DiplomaticAttachments[];
125
+
126
+ @OneToMany('DiplomaticChats', 'diplomaticRequest')
127
+ chats?: DiplomaticChats[];
128
+
129
+ constructor(
130
+ user_id: number,
131
+ employee_id: string,
132
+ employee_name: string,
133
+ email_address: string,
134
+ contact_number: string,
135
+ service_id: number | null,
136
+ sub_service_id: number | null,
137
+ section_id: number | null,
138
+ reporting_manager: number | null
139
+ ) {
140
+ super();
141
+ this.user_id = user_id;
142
+ this.employee_id = employee_id;
143
+ this.employee_name = employee_name;
144
+ this.email_address = email_address;
145
+ this.contact_number = contact_number;
146
+ this.request_date = new Date();
147
+ this.request_status = DiplomaticRequestStatus.PENDING;
148
+ this.service_id = service_id;
149
+ this.sub_service_id = sub_service_id;
150
+ this.section_id = section_id;
151
+ this.reporting_manager = reporting_manager;
152
+ }
153
+ }
154
+
@@ -0,0 +1,87 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ /**
5
+ * Approval Status Enum
6
+ */
7
+ export enum EmployeeCardApprovalStatus {
8
+ PENDING = "Pending",
9
+ APPROVED = "Approved",
10
+ REJECTED = "Rejected",
11
+ IN_PROGRESS = "In Progress",
12
+ CANCELLED = "Cancelled"
13
+ }
14
+
15
+ /**
16
+ * Employee Card Approval Details Table
17
+ * Stores approval information for each level of the workflow
18
+ * Supports workflow: Employee → Department Admin Office → US (if Special) → Security
19
+ */
20
+ @Entity({ name: 'employee_card_approvals' })
21
+ export class EmployeeCardApprovalDetails extends BaseModel {
22
+
23
+ @Column({ type: 'int', nullable: false })
24
+ employee_card_request_id: number; // Foreign key to employee_card_requests
25
+
26
+ @Column({ type: 'int', nullable: false })
27
+ level: number; // Approval level (1: Dept Admin, 2: US for Special/Security for Normal, 3: Security for Special)
28
+
29
+ @Column({ type: 'int', nullable: true })
30
+ approver_user_id: number | null;
31
+
32
+ @Column({ type: 'int', nullable: true })
33
+ approver_role_id: number | null;
34
+
35
+ @Column({ type: 'integer', nullable: true })
36
+ delegate_user_id: number | null; // If someone is delegating approval
37
+
38
+ @Column({ type: 'integer', nullable: true })
39
+ approved_by: number | null; // Actual user who approved (in case of delegation)
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: 'text', nullable: true })
48
+ comment: string | null; // Approval/rejection comment
49
+
50
+ @Column({ type: 'enum', enum: EmployeeCardApprovalStatus, default: EmployeeCardApprovalStatus.PENDING, nullable: false })
51
+ approval_status: EmployeeCardApprovalStatus;
52
+
53
+ @Column({ type: 'boolean', default: true, nullable: false })
54
+ is_allowed: boolean; // Whether this approval step is allowed
55
+
56
+ @Column({ type: 'varchar', length: 50, nullable: true })
57
+ access_type: string | null; // Normal or Special - to track which path
58
+
59
+ constructor(
60
+ employee_card_request_id: number,
61
+ level: number,
62
+ approver_user_id: number | null,
63
+ approver_role_id: number | null,
64
+ delegate_user_id: number | null,
65
+ approved_by: number | null,
66
+ department_id: number | null,
67
+ section_id: number | null,
68
+ comment: string | null,
69
+ approval_status: EmployeeCardApprovalStatus,
70
+ is_allowed: boolean,
71
+ access_type: string | null
72
+ ) {
73
+ super();
74
+ this.employee_card_request_id = employee_card_request_id;
75
+ this.level = level;
76
+ this.approver_user_id = approver_user_id;
77
+ this.approver_role_id = approver_role_id;
78
+ this.delegate_user_id = delegate_user_id;
79
+ this.approved_by = approved_by;
80
+ this.department_id = department_id;
81
+ this.section_id = section_id;
82
+ this.comment = comment;
83
+ this.approval_status = approval_status;
84
+ this.is_allowed = is_allowed;
85
+ this.access_type = access_type;
86
+ }
87
+ }
@@ -0,0 +1,56 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ /**
5
+ * Employee Card Attachments Table
6
+ * Stores file attachments related to employee card requests
7
+ * Can be attached during initial request or via chat
8
+ */
9
+ @Entity({ name: 'employee_card_attachments' })
10
+ export class EmployeeCardAttachments extends BaseModel {
11
+
12
+ @Column({ type: 'int', nullable: false })
13
+ employee_card_request_id: number; // Foreign key to employee_card_requests
14
+
15
+ @Column({ type: 'int', nullable: false })
16
+ attached_by_user_id: number; // User who uploaded the attachment
17
+
18
+ @Column({ type: 'varchar', length: 500, nullable: false })
19
+ file_url: string; // URL/path to the file
20
+
21
+ @Column({ type: 'varchar', length: 255, nullable: true })
22
+ file_name: string | null; // Original file name
23
+
24
+ @Column({ type: 'varchar', length: 100, nullable: true })
25
+ file_type: string | null; // MIME type (e.g., image/jpeg, application/pdf)
26
+
27
+ @Column({ type: 'bigint', nullable: true })
28
+ file_size: number | null; // File size in bytes
29
+
30
+ @Column({ type: 'integer', nullable: true })
31
+ chat_id: number | null; // Reference to chat message if attached via chat
32
+
33
+ @Column({ type: 'varchar', length: 255, nullable: true })
34
+ description: string | null; // Optional description of the attachment
35
+
36
+ constructor(
37
+ employee_card_request_id: number,
38
+ attached_by_user_id: number,
39
+ file_url: string,
40
+ file_name: string | null,
41
+ file_type: string | null,
42
+ file_size: number | null,
43
+ chat_id: number | null,
44
+ description: string | null
45
+ ) {
46
+ super();
47
+ this.employee_card_request_id = employee_card_request_id;
48
+ this.attached_by_user_id = attached_by_user_id;
49
+ this.file_url = file_url;
50
+ this.file_name = file_name;
51
+ this.file_type = file_type;
52
+ this.file_size = file_size;
53
+ this.chat_id = chat_id;
54
+ this.description = description;
55
+ }
56
+ }
@@ -0,0 +1,66 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ /**
5
+ * Employee Card Chat/Communication Table
6
+ * Stores messages/comments between the requester and approvers
7
+ * Allows discussion regarding the employee card request
8
+ */
9
+ @Entity({ name: 'employee_card_chats' })
10
+ export class EmployeeCardChat extends BaseModel {
11
+
12
+ @Column({ type: 'int', nullable: false })
13
+ employee_card_request_id: number; // Foreign key to employee_card_requests
14
+
15
+ @Column({ type: 'text', nullable: false })
16
+ content: string; // Chat message content
17
+
18
+ @Column({ type: 'int', nullable: false })
19
+ sender_user_id: number; // User who sent the message
20
+
21
+ @Column({ type: 'integer', nullable: true })
22
+ service_id: number | null; // Service context
23
+
24
+ @Column({ type: 'integer', nullable: true })
25
+ sub_service_id: number | null; // Sub-service context
26
+
27
+ @Column({ type: 'integer', nullable: true })
28
+ role_id: number | null; // Role of the sender
29
+
30
+ @Column({ type: 'varchar', length: 255, nullable: true })
31
+ status: string | null; // Status of the request at the time of message
32
+
33
+ @Column({ type: 'integer', nullable: true })
34
+ department_id: number | null; // Department of the sender
35
+
36
+ @Column({ type: 'integer', nullable: true })
37
+ section_id: number | null; // Section of the sender
38
+
39
+ @Column({ type: 'boolean', default: false, nullable: true })
40
+ is_internal: boolean | null; // Flag to mark internal notes (visible only to approvers)
41
+
42
+ constructor(
43
+ employee_card_request_id: number,
44
+ content: string,
45
+ sender_user_id: number,
46
+ service_id: number | null,
47
+ sub_service_id: number | null,
48
+ role_id: number | null,
49
+ status: string | null,
50
+ department_id: number | null,
51
+ section_id: number | null,
52
+ is_internal: boolean | null
53
+ ) {
54
+ super();
55
+ this.employee_card_request_id = employee_card_request_id;
56
+ this.content = content;
57
+ this.sender_user_id = sender_user_id;
58
+ this.service_id = service_id;
59
+ this.sub_service_id = sub_service_id;
60
+ this.role_id = role_id;
61
+ this.status = status;
62
+ this.department_id = department_id;
63
+ this.section_id = section_id;
64
+ this.is_internal = is_internal;
65
+ }
66
+ }
@@ -0,0 +1,115 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ /**
5
+ * Employee Card Request Status Enum
6
+ */
7
+ export enum EmployeeCardRequestStatus {
8
+ PENDING = "Pending",
9
+ APPROVED = "Approved",
10
+ REJECTED = "Rejected",
11
+ CANCELLED = "Cancelled"
12
+ }
13
+
14
+ /**
15
+ * Access Type Enum - Normal or Special
16
+ */
17
+ export enum AccessType {
18
+ NORMAL = "Normal",
19
+ SPECIAL = "Special"
20
+ }
21
+
22
+ /**
23
+ * Main Employee Card Request Table (FM020)
24
+ * This table stores the primary employee card request data
25
+ */
26
+ @Entity({ name: 'employee_card_requests' })
27
+ export class EmployeeCardRequests extends BaseModel {
28
+
29
+ // User and Department Information
30
+ @Column({ type: 'int', nullable: false })
31
+ user_id: number;
32
+
33
+ @Column({ type: 'int', nullable: true })
34
+ req_user_department_id: number | null;
35
+
36
+ @Column({ type: 'int', nullable: true })
37
+ req_user_section_id: number | null;
38
+
39
+ @Column({ type: 'int', nullable: true })
40
+ service_id: number | null;
41
+
42
+ @Column({ type: 'int', nullable: true })
43
+ sub_service_id: number | null;
44
+
45
+ // Request Status and Workflow
46
+ @Column({ type: 'enum', enum: EmployeeCardRequestStatus, default: EmployeeCardRequestStatus.PENDING, nullable: false })
47
+ status: EmployeeCardRequestStatus;
48
+
49
+ @Column({ type: 'varchar', length: 255, nullable: true })
50
+ workflow_execution_id: string | null;
51
+
52
+ @Column({ type: 'varchar', length: 100, nullable: true })
53
+ number: string | null;
54
+
55
+ @Column({ type: 'varchar', length: 255, nullable: true })
56
+ name: string | null;
57
+
58
+ @Column({ type: 'varchar', length: 255, nullable: true })
59
+ job_title: string | null;
60
+
61
+ @Column({ type: 'text', nullable: true })
62
+ reason_for_request: string | null;
63
+
64
+ @Column({ type: 'date', nullable: true })
65
+ date_of_joining: Date | null;
66
+
67
+ @Column({ type: 'date', nullable: true })
68
+ date_of_issue: Date | null;
69
+ @Column({ type: 'enum', enum: AccessType, default: AccessType.NORMAL, nullable: false })
70
+ access_type: AccessType; // Normal / Special (Radio Button)
71
+
72
+ // Photo from Profile (URL or reference)
73
+ @Column({ type: 'varchar', length: 500, nullable: true })
74
+ photo_url: string | null; // Photo pulled from profile data
75
+
76
+ @Column({ type: 'varchar', length: 255, nullable: true })
77
+ photo_file_name: string | null;
78
+
79
+ constructor(
80
+ user_id: number,
81
+ req_user_department_id: number | null,
82
+ req_user_section_id: number | null,
83
+ service_id: number | null,
84
+ sub_service_id: number | null,
85
+ status: EmployeeCardRequestStatus,
86
+ workflow_execution_id: string | null,
87
+ number: string | null,
88
+ name: string | null,
89
+ job_title: string | null,
90
+ reason_for_request: string | null,
91
+ date_of_joining: Date | null,
92
+ date_of_issue: Date | null,
93
+ access_type: AccessType,
94
+ photo_url: string | null,
95
+ photo_file_name: string | null
96
+ ) {
97
+ super();
98
+ this.user_id = user_id;
99
+ this.req_user_department_id = req_user_department_id;
100
+ this.req_user_section_id = req_user_section_id;
101
+ this.service_id = service_id;
102
+ this.sub_service_id = sub_service_id;
103
+ this.status = status;
104
+ this.workflow_execution_id = workflow_execution_id;
105
+ this.number = number;
106
+ this.name = name;
107
+ this.job_title = job_title;
108
+ this.reason_for_request = reason_for_request;
109
+ this.date_of_joining = date_of_joining;
110
+ this.date_of_issue = date_of_issue;
111
+ this.access_type = access_type;
112
+ this.photo_url = photo_url;
113
+ this.photo_file_name = photo_file_name;
114
+ }
115
+ }