@platform-modules/foreign-ministry 1.2.21 → 1.2.22

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 (83) hide show
  1. package/dist/data-source.js +11 -1
  2. package/dist/index.d.ts +6 -0
  3. package/dist/index.js +6 -0
  4. package/dist/models/DiplomaticClubCardApprovalModel.d.ts +16 -0
  5. package/dist/models/DiplomaticClubCardApprovalModel.js +58 -0
  6. package/dist/models/DiplomaticClubCardAttachmentModel.d.ts +9 -0
  7. package/dist/models/DiplomaticClubCardAttachmentModel.js +44 -0
  8. package/dist/models/DiplomaticClubCardChatModel.d.ts +7 -0
  9. package/dist/models/DiplomaticClubCardChatModel.js +36 -0
  10. package/dist/models/DiplomaticClubCardMemberModel.d.ts +13 -0
  11. package/dist/models/DiplomaticClubCardMemberModel.js +60 -0
  12. package/dist/models/DiplomaticClubCardRequestModel.d.ts +33 -0
  13. package/dist/models/DiplomaticClubCardRequestModel.js +98 -0
  14. package/dist/models/DiplomaticClubCardWorkFlowModel.d.ts +12 -0
  15. package/dist/models/DiplomaticClubCardWorkFlowModel.js +42 -0
  16. package/dist/models/DiplomaticServiceDetailsModel.d.ts +20 -0
  17. package/dist/models/DiplomaticServiceDetailsModel.js +65 -0
  18. package/dist/models/DiplomaticSettingsModel.d.ts +11 -0
  19. package/dist/models/DiplomaticSettingsModel.js +59 -0
  20. package/dist/models/DiplomaticTitleModel.d.ts +12 -0
  21. package/dist/models/DiplomaticTitleModel.js +45 -0
  22. package/dist/models/EmployeeCardApprovalsModel.d.ts +31 -0
  23. package/dist/models/EmployeeCardApprovalsModel.js +100 -0
  24. package/dist/models/EmployeeCardAttachmentsModel.d.ts +17 -0
  25. package/dist/models/EmployeeCardAttachmentsModel.js +69 -0
  26. package/dist/models/EmployeeCardChatsModel.d.ts +19 -0
  27. package/dist/models/EmployeeCardChatsModel.js +79 -0
  28. package/dist/models/EmployeeCardRequestsModel.d.ts +40 -0
  29. package/dist/models/EmployeeCardRequestsModel.js +126 -0
  30. package/dist/models/EmployeeCardWorkFlowModel.d.ts +34 -0
  31. package/dist/models/EmployeeCardWorkFlowModel.js +103 -0
  32. package/dist/models/PassportRequestApprovalModel.d.ts +22 -0
  33. package/dist/models/PassportRequestApprovalModel.js +91 -0
  34. package/dist/models/PassportRequestAttachmentModel.d.ts +10 -0
  35. package/dist/models/PassportRequestAttachmentModel.js +54 -0
  36. package/dist/models/PassportRequestChatModel.d.ts +8 -0
  37. package/dist/models/PassportRequestChatModel.js +44 -0
  38. package/dist/models/PassportRequestDependentModel.d.ts +20 -0
  39. package/dist/models/PassportRequestDependentModel.js +85 -0
  40. package/dist/models/PassportRequestModel.d.ts +40 -0
  41. package/dist/models/PassportRequestModel.js +128 -0
  42. package/dist/models/PassportRequestWorkFlowModel.d.ts +15 -0
  43. package/dist/models/PassportRequestWorkFlowModel.js +60 -0
  44. package/dist/models/SubscriptionAmountModel.d.ts +67 -0
  45. package/dist/models/SubscriptionAmountModel.js +114 -0
  46. package/package.json +1 -1
  47. package/src/data-source.ts +11 -1
  48. package/src/index.ts +7 -1
  49. package/src/models/DiplomaticClubSubscriptionMasterModel.ts +26 -26
  50. package/src/models/DiplomaticRequestsModel.ts +154 -154
  51. package/src/models/EmployeeCardApprovalsModel.ts +87 -0
  52. package/src/models/EmployeeCardAttachmentsModel.ts +56 -0
  53. package/src/models/EmployeeCardChatsModel.ts +66 -0
  54. package/src/models/EmployeeCardRequestsModel.ts +115 -0
  55. package/src/models/EmployeeCardWorkFlowModel.ts +90 -0
  56. package/src/models/LeaveConfigModel.ts +71 -71
  57. package/dist/models/MissionTravelApprovalModel.d.ts +0 -22
  58. package/dist/models/MissionTravelApprovalModel.js +0 -79
  59. package/dist/models/MissionTravelAttachmentModel.d.ts +0 -11
  60. package/dist/models/MissionTravelAttachmentModel.js +0 -52
  61. package/dist/models/MissionTravelChatModel.d.ts +0 -9
  62. package/dist/models/MissionTravelChatModel.js +0 -44
  63. package/dist/models/MissionTravelClassConfigModel.d.ts +0 -10
  64. package/dist/models/MissionTravelClassConfigModel.js +0 -50
  65. package/dist/models/MissionTravelCostModel.d.ts +0 -14
  66. package/dist/models/MissionTravelCostModel.js +0 -74
  67. package/dist/models/MissionTravelPerdiemModel.d.ts +0 -10
  68. package/dist/models/MissionTravelPerdiemModel.js +0 -54
  69. package/dist/models/MissionTravelPersonModel.d.ts +0 -32
  70. package/dist/models/MissionTravelPersonModel.js +0 -126
  71. package/dist/models/MissionTravelRequestModel.d.ts +0 -40
  72. package/dist/models/MissionTravelRequestModel.js +0 -138
  73. package/dist/models/MissionTravelWorkflowModel.d.ts +0 -13
  74. package/dist/models/MissionTravelWorkflowModel.js +0 -60
  75. package/src/models/MissionTravelApprovalModel.ts +0 -53
  76. package/src/models/MissionTravelAttachmentModel.ts +0 -32
  77. package/src/models/MissionTravelChatModel.ts +0 -26
  78. package/src/models/MissionTravelClassConfigModel.ts +0 -39
  79. package/src/models/MissionTravelCostModel.ts +0 -64
  80. package/src/models/MissionTravelPerdiemModel.ts +0 -43
  81. package/src/models/MissionTravelPersonModel.ts +0 -116
  82. package/src/models/MissionTravelRequestModel.ts +0 -126
  83. package/src/models/MissionTravelWorkflowModel.ts +0 -38
@@ -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
+ }
@@ -0,0 +1,90 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ /**
5
+ * Workflow Status Enum
6
+ */
7
+ export enum EmployeeCardWorkFlowStatus {
8
+ COMPLETED = "Completed",
9
+ NOT_YET_STARTED = "Not Yet Started",
10
+ PENDING = "Pending",
11
+ IN_PROGRESS = "In Progress"
12
+ }
13
+
14
+ /**
15
+ * Employee Card Workflow Table
16
+ * Tracks the progress of the request through different workflow stages
17
+ * Provides a timeline/audit trail of the approval process
18
+ *
19
+ * Workflow paths:
20
+ * - Normal: Employee → Department Admin Office → Security
21
+ * - Special: Employee → Department Admin Office → US → Security
22
+ */
23
+ @Entity({ name: 'employee_card_work_flows' })
24
+ export class EmployeeCardWorkFlow extends BaseModel {
25
+
26
+ @Column({ type: 'int', nullable: false })
27
+ employee_card_request_id: number; // Foreign key to employee_card_requests
28
+
29
+ @Column({ type: 'int', nullable: false, default: 0 })
30
+ employee_card_approval_details_id: number; // Foreign key to employee_card_approvals
31
+
32
+ @Column({ type: 'varchar', length: 255, nullable: false })
33
+ content: string; // Description of the workflow step (e.g., "Pending Department Admin Office Approval")
34
+
35
+ @Column({ type: 'enum', enum: EmployeeCardWorkFlowStatus, default: EmployeeCardWorkFlowStatus.NOT_YET_STARTED, nullable: false })
36
+ status: EmployeeCardWorkFlowStatus; // Current status of this workflow step
37
+
38
+ @Column({ type: 'integer', nullable: true })
39
+ user_id: number | null; // User responsible for this step
40
+
41
+ @Column({ type: 'integer', nullable: true })
42
+ role_id: number | null; // Role responsible for this step
43
+
44
+ @Column({ type: 'integer', nullable: true })
45
+ department_id: number | null; // Department involved in this step
46
+
47
+ @Column({ type: 'integer', nullable: true })
48
+ section_id: number | null; // Section involved in this step
49
+
50
+ @Column({ type: 'integer', nullable: false, default: 1 })
51
+ level: number; // Workflow level (1: Dept Admin, 2: US/Security, 3: Security for Special)
52
+
53
+ @Column({ type: 'varchar', length: 50, nullable: true })
54
+ access_type: string | null; // Normal or Special - to track workflow path
55
+
56
+ @Column({ type: 'varchar', length: 255, nullable: true })
57
+ action_taken: string | null; // Action taken (e.g., "Approved", "Rejected", "Forwarded")
58
+
59
+ @Column({ type: 'timestamptz', nullable: true })
60
+ action_date: Date | null; // When the action was taken
61
+
62
+ constructor(
63
+ employee_card_request_id: number,
64
+ employee_card_approval_details_id: number,
65
+ content: string,
66
+ status: EmployeeCardWorkFlowStatus,
67
+ user_id: number | null,
68
+ role_id: number | null,
69
+ department_id: number | null,
70
+ section_id: number | null,
71
+ level: number,
72
+ access_type: string | null,
73
+ action_taken: string | null,
74
+ action_date: Date | null
75
+ ) {
76
+ super();
77
+ this.employee_card_request_id = employee_card_request_id;
78
+ this.employee_card_approval_details_id = employee_card_approval_details_id;
79
+ this.content = content;
80
+ this.status = status;
81
+ this.user_id = user_id;
82
+ this.role_id = role_id;
83
+ this.department_id = department_id;
84
+ this.section_id = section_id;
85
+ this.level = level;
86
+ this.access_type = access_type;
87
+ this.action_taken = action_taken;
88
+ this.action_date = action_date;
89
+ }
90
+ }
@@ -1,72 +1,72 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
-
4
- export enum enumFrequency {
5
- Monthly = 'Monthly',
6
- Yearly = 'Yearly',
7
- }
8
-
9
- //This model is used to store the Financial Grade declaration on the Admin Side
10
- @Entity({ name: 'leave_configuration' })
11
- export class LeaveConfiguration extends BaseModel {
12
-
13
- @Column({ type: 'varchar', nullable: true })
14
- category: string;
15
-
16
- @Column({ type: 'int', nullable: true })
17
- MandC_id: number;
18
-
19
- @Column({ type: 'int', nullable: true })
20
- leave_type_id: number;
21
-
22
- @Column({ type: 'varchar', nullable: true })
23
- frequency: enumFrequency;
24
-
25
- @Column({ type: 'varchar', nullable: true })
26
- region: string;
27
-
28
- @Column({ type: 'varchar', nullable: true })
29
- country: string;
30
-
31
- @Column({ type: 'varchar', nullable: true })
32
- location: string;
33
-
34
- @Column({ nullable: true, default: false })
35
- is_carryforward: boolean;
36
-
37
- @Column({ type: 'int', nullable: true, default: 0 })
38
- carryforward_limit: number;
39
-
40
- @Column({ type: 'date', nullable: true })
41
- from_date: Date;
42
-
43
- @Column({ type: 'date', nullable: true })
44
- to_date: Date;
45
-
46
- @Column({ type: 'varchar', nullable: true })
47
- reason: string;
48
-
49
- @Column({ type: 'int', nullable: true })
50
- emergency_balance_days: number | null;
51
-
52
- @Column({ type: 'date', nullable: true })
53
- last_credited: Date | null;
54
-
55
- constructor(category: string, MandC_id: number, leave_type_id: number, frequency: enumFrequency, region: string, country: string, location: string, is_carryforward: boolean, carryforward_limit: number, from_date: Date, to_date: Date, reason: string, emergency_balance_days?: number|null, last_credited?: Date|null) {
56
- super();
57
- this.category = category;
58
- this.MandC_id = MandC_id;
59
- this.leave_type_id = leave_type_id;
60
- this.frequency = frequency;
61
- this.region = region;
62
- this.country = country;
63
- this.location = location;
64
- this.is_carryforward = is_carryforward;
65
- this.carryforward_limit = carryforward_limit;
66
- this.from_date = from_date;
67
- this.to_date = to_date;
68
- this.reason = reason;
69
- this.emergency_balance_days = emergency_balance_days ?? null;
70
- this.last_credited = last_credited ?? null;
71
- }
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum enumFrequency {
5
+ Monthly = 'Monthly',
6
+ Yearly = 'Yearly',
7
+ }
8
+
9
+ //This model is used to store the Financial Grade declaration on the Admin Side
10
+ @Entity({ name: 'leave_configuration' })
11
+ export class LeaveConfiguration extends BaseModel {
12
+
13
+ @Column({ type: 'varchar', nullable: true })
14
+ category: string;
15
+
16
+ @Column({ type: 'int', nullable: true })
17
+ MandC_id: number;
18
+
19
+ @Column({ type: 'int', nullable: true })
20
+ leave_type_id: number;
21
+
22
+ @Column({ type: 'varchar', nullable: true })
23
+ frequency: enumFrequency;
24
+
25
+ @Column({ type: 'varchar', nullable: true })
26
+ region: string;
27
+
28
+ @Column({ type: 'varchar', nullable: true })
29
+ country: string;
30
+
31
+ @Column({ type: 'varchar', nullable: true })
32
+ location: string;
33
+
34
+ @Column({ nullable: true, default: false })
35
+ is_carryforward: boolean;
36
+
37
+ @Column({ type: 'int', nullable: true, default: 0 })
38
+ carryforward_limit: number;
39
+
40
+ @Column({ type: 'date', nullable: true })
41
+ from_date: Date;
42
+
43
+ @Column({ type: 'date', nullable: true })
44
+ to_date: Date;
45
+
46
+ @Column({ type: 'varchar', nullable: true })
47
+ reason: string;
48
+
49
+ @Column({ type: 'int', nullable: true })
50
+ emergency_balance_days: number | null;
51
+
52
+ @Column({ type: 'date', nullable: true })
53
+ last_credited: Date | null;
54
+
55
+ constructor(category: string, MandC_id: number, leave_type_id: number, frequency: enumFrequency, region: string, country: string, location: string, is_carryforward: boolean, carryforward_limit: number, from_date: Date, to_date: Date, reason: string, emergency_balance_days?: number|null, last_credited?: Date|null) {
56
+ super();
57
+ this.category = category;
58
+ this.MandC_id = MandC_id;
59
+ this.leave_type_id = leave_type_id;
60
+ this.frequency = frequency;
61
+ this.region = region;
62
+ this.country = country;
63
+ this.location = location;
64
+ this.is_carryforward = is_carryforward;
65
+ this.carryforward_limit = carryforward_limit;
66
+ this.from_date = from_date;
67
+ this.to_date = to_date;
68
+ this.reason = reason;
69
+ this.emergency_balance_days = emergency_balance_days ?? null;
70
+ this.last_credited = last_credited ?? null;
71
+ }
72
72
  }
@@ -1,22 +0,0 @@
1
- import { BaseModel } from './BaseModel';
2
- export declare enum MissionTravelApprovalStatus {
3
- PENDING = "Pending",
4
- APPROVED = "Approved",
5
- REJECTED = "Rejected",
6
- RFC = "RFC"
7
- }
8
- export declare class MissionTravelApprovalDetails extends BaseModel {
9
- request_id: number;
10
- service_id: number | null;
11
- sub_service_id: number | null;
12
- level: number;
13
- approver_role_id: number;
14
- department_id: number | null;
15
- section_id: number | null;
16
- approver_user_id: number | null;
17
- delegate_user_id: number | null;
18
- approved_by: number | null;
19
- comment: string;
20
- approval_status: MissionTravelApprovalStatus;
21
- is_allowed: boolean;
22
- }
@@ -1,79 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MissionTravelApprovalDetails = exports.MissionTravelApprovalStatus = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const BaseModel_1 = require("./BaseModel");
15
- var MissionTravelApprovalStatus;
16
- (function (MissionTravelApprovalStatus) {
17
- MissionTravelApprovalStatus["PENDING"] = "Pending";
18
- MissionTravelApprovalStatus["APPROVED"] = "Approved";
19
- MissionTravelApprovalStatus["REJECTED"] = "Rejected";
20
- MissionTravelApprovalStatus["RFC"] = "RFC"; // Request for Change
21
- })(MissionTravelApprovalStatus || (exports.MissionTravelApprovalStatus = MissionTravelApprovalStatus = {}));
22
- let MissionTravelApprovalDetails = class MissionTravelApprovalDetails extends BaseModel_1.BaseModel {
23
- };
24
- exports.MissionTravelApprovalDetails = MissionTravelApprovalDetails;
25
- __decorate([
26
- (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
27
- __metadata("design:type", Number)
28
- ], MissionTravelApprovalDetails.prototype, "request_id", void 0);
29
- __decorate([
30
- (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
31
- __metadata("design:type", Object)
32
- ], MissionTravelApprovalDetails.prototype, "service_id", void 0);
33
- __decorate([
34
- (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
35
- __metadata("design:type", Object)
36
- ], MissionTravelApprovalDetails.prototype, "sub_service_id", void 0);
37
- __decorate([
38
- (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
39
- __metadata("design:type", Number)
40
- ], MissionTravelApprovalDetails.prototype, "level", void 0);
41
- __decorate([
42
- (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
43
- __metadata("design:type", Number)
44
- ], MissionTravelApprovalDetails.prototype, "approver_role_id", void 0);
45
- __decorate([
46
- (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
47
- __metadata("design:type", Object)
48
- ], MissionTravelApprovalDetails.prototype, "department_id", void 0);
49
- __decorate([
50
- (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
51
- __metadata("design:type", Object)
52
- ], MissionTravelApprovalDetails.prototype, "section_id", void 0);
53
- __decorate([
54
- (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
55
- __metadata("design:type", Object)
56
- ], MissionTravelApprovalDetails.prototype, "approver_user_id", void 0);
57
- __decorate([
58
- (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
59
- __metadata("design:type", Object)
60
- ], MissionTravelApprovalDetails.prototype, "delegate_user_id", void 0);
61
- __decorate([
62
- (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
63
- __metadata("design:type", Object)
64
- ], MissionTravelApprovalDetails.prototype, "approved_by", void 0);
65
- __decorate([
66
- (0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true, default: '' }),
67
- __metadata("design:type", String)
68
- ], MissionTravelApprovalDetails.prototype, "comment", void 0);
69
- __decorate([
70
- (0, typeorm_1.Column)({ type: 'enum', enum: MissionTravelApprovalStatus, default: MissionTravelApprovalStatus.PENDING, nullable: false }),
71
- __metadata("design:type", String)
72
- ], MissionTravelApprovalDetails.prototype, "approval_status", void 0);
73
- __decorate([
74
- (0, typeorm_1.Column)({ type: 'boolean', default: true, nullable: false }),
75
- __metadata("design:type", Boolean)
76
- ], MissionTravelApprovalDetails.prototype, "is_allowed", void 0);
77
- exports.MissionTravelApprovalDetails = MissionTravelApprovalDetails = __decorate([
78
- (0, typeorm_1.Entity)({ name: 'mission_travel_approvals' })
79
- ], MissionTravelApprovalDetails);
@@ -1,11 +0,0 @@
1
- import { BaseModel } from './BaseModel';
2
- export declare class MissionTravelRequestAttachment extends BaseModel {
3
- request_id: number;
4
- service_id: number | null;
5
- sub_service_id: number | null;
6
- file_name: string;
7
- file_path: string | null;
8
- file_type: string | null;
9
- file_size: number | null;
10
- uploaded_by: string | null;
11
- }