@classytic/payroll 1.0.0 → 1.0.2
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.
Potentially problematic release.
This version of @classytic/payroll might be problematic. Click here for more details.
- package/dist/types/config.d.ts +162 -0
- package/dist/types/core/compensation.manager.d.ts +54 -0
- package/dist/types/core/employment.manager.d.ts +49 -0
- package/dist/types/core/payroll.manager.d.ts +60 -0
- package/dist/types/enums.d.ts +117 -0
- package/dist/types/factories/compensation.factory.d.ts +196 -0
- package/dist/types/factories/employee.factory.d.ts +149 -0
- package/dist/types/factories/payroll.factory.d.ts +319 -0
- package/dist/types/hrm.orchestrator.d.ts +47 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/types/init.d.ts +30 -0
- package/dist/types/models/payroll-record.model.d.ts +3 -0
- package/dist/types/plugins/employee.plugin.d.ts +2 -0
- package/dist/types/schemas/employment.schema.d.ts +959 -0
- package/dist/types/services/compensation.service.d.ts +94 -0
- package/dist/types/services/employee.service.d.ts +28 -0
- package/dist/types/services/payroll.service.d.ts +30 -0
- package/dist/types/utils/calculation.utils.d.ts +26 -0
- package/dist/types/utils/date.utils.d.ts +35 -0
- package/dist/types/utils/logger.d.ts +12 -0
- package/dist/types/utils/query-builders.d.ts +83 -0
- package/dist/types/utils/validation.utils.d.ts +33 -0
- package/package.json +34 -13
- package/payroll.d.ts +241 -0
- package/src/factories/payroll.factory.js +167 -1
- package/src/init.js +21 -0
- package/src/plugins/employee.plugin.js +9 -2
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
export function calculateTax(annualIncome: any, currency?: string): number;
|
|
2
|
+
export function getSalaryBand(amount: any): string;
|
|
3
|
+
/**
|
|
4
|
+
* Determines the appropriate organization role for an employee
|
|
5
|
+
* Based on department, employment type, and position
|
|
6
|
+
* @param {Object} employmentData - Employee's employment data
|
|
7
|
+
* @param {string} employmentData.department - Employee's department
|
|
8
|
+
* @param {string} employmentData.type - Employment type (full_time, intern, etc.)
|
|
9
|
+
* @param {string} employmentData.position - Job position/title
|
|
10
|
+
* @returns {string} Organization role key
|
|
11
|
+
*/
|
|
12
|
+
export function determineOrgRole(employmentData?: {
|
|
13
|
+
department: string;
|
|
14
|
+
type: string;
|
|
15
|
+
position: string;
|
|
16
|
+
}): string;
|
|
17
|
+
export namespace HRM_CONFIG {
|
|
18
|
+
namespace dataRetention {
|
|
19
|
+
let payrollRecordsTTL: number;
|
|
20
|
+
let exportWarningDays: number;
|
|
21
|
+
}
|
|
22
|
+
namespace payroll {
|
|
23
|
+
let defaultCurrency: string;
|
|
24
|
+
let allowProRating: boolean;
|
|
25
|
+
let attendanceIntegration: boolean;
|
|
26
|
+
let autoDeductions: boolean;
|
|
27
|
+
let overtimeEnabled: boolean;
|
|
28
|
+
}
|
|
29
|
+
namespace salary {
|
|
30
|
+
let minimumWage: number;
|
|
31
|
+
let maximumAllowances: number;
|
|
32
|
+
let maximumDeductions: number;
|
|
33
|
+
let defaultFrequency: string;
|
|
34
|
+
}
|
|
35
|
+
namespace employment {
|
|
36
|
+
let defaultProbationMonths: number;
|
|
37
|
+
let maxProbationMonths: number;
|
|
38
|
+
let allowReHiring: boolean;
|
|
39
|
+
let trackEmploymentHistory: boolean;
|
|
40
|
+
}
|
|
41
|
+
namespace validation {
|
|
42
|
+
let requireBankDetails: boolean;
|
|
43
|
+
let requireEmployeeId: boolean;
|
|
44
|
+
let uniqueEmployeeIdPerOrg: boolean;
|
|
45
|
+
let allowMultiTenantEmployees: boolean;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export namespace ORG_ROLES {
|
|
49
|
+
namespace OWNER {
|
|
50
|
+
let key: string;
|
|
51
|
+
let label: string;
|
|
52
|
+
let description: string;
|
|
53
|
+
}
|
|
54
|
+
namespace MANAGER {
|
|
55
|
+
let key_1: string;
|
|
56
|
+
export { key_1 as key };
|
|
57
|
+
let label_1: string;
|
|
58
|
+
export { label_1 as label };
|
|
59
|
+
let description_1: string;
|
|
60
|
+
export { description_1 as description };
|
|
61
|
+
}
|
|
62
|
+
namespace TRAINER {
|
|
63
|
+
let key_2: string;
|
|
64
|
+
export { key_2 as key };
|
|
65
|
+
let label_2: string;
|
|
66
|
+
export { label_2 as label };
|
|
67
|
+
let description_2: string;
|
|
68
|
+
export { description_2 as description };
|
|
69
|
+
}
|
|
70
|
+
namespace STAFF {
|
|
71
|
+
let key_3: string;
|
|
72
|
+
export { key_3 as key };
|
|
73
|
+
let label_3: string;
|
|
74
|
+
export { label_3 as label };
|
|
75
|
+
let description_3: string;
|
|
76
|
+
export { description_3 as description };
|
|
77
|
+
}
|
|
78
|
+
namespace INTERN {
|
|
79
|
+
let key_4: string;
|
|
80
|
+
export { key_4 as key };
|
|
81
|
+
let label_4: string;
|
|
82
|
+
export { label_4 as label };
|
|
83
|
+
let description_4: string;
|
|
84
|
+
export { description_4 as description };
|
|
85
|
+
}
|
|
86
|
+
namespace CONSULTANT {
|
|
87
|
+
let key_5: string;
|
|
88
|
+
export { key_5 as key };
|
|
89
|
+
let label_5: string;
|
|
90
|
+
export { label_5 as label };
|
|
91
|
+
let description_5: string;
|
|
92
|
+
export { description_5 as description };
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export const ORG_ROLE_KEYS: string[];
|
|
96
|
+
export namespace ROLE_MAPPING {
|
|
97
|
+
export namespace byDepartment {
|
|
98
|
+
let management: string;
|
|
99
|
+
let training: string;
|
|
100
|
+
let sales: string;
|
|
101
|
+
let operations: string;
|
|
102
|
+
let finance: string;
|
|
103
|
+
let hr: string;
|
|
104
|
+
let marketing: string;
|
|
105
|
+
let it: string;
|
|
106
|
+
let support: string;
|
|
107
|
+
}
|
|
108
|
+
export namespace byEmploymentType {
|
|
109
|
+
let full_time: string;
|
|
110
|
+
let part_time: string;
|
|
111
|
+
let contract: string;
|
|
112
|
+
let intern: string;
|
|
113
|
+
let consultant: string;
|
|
114
|
+
}
|
|
115
|
+
let _default: string;
|
|
116
|
+
export { _default as default };
|
|
117
|
+
}
|
|
118
|
+
export namespace SALARY_BANDS {
|
|
119
|
+
export namespace intern_1 {
|
|
120
|
+
let min: number;
|
|
121
|
+
let max: number;
|
|
122
|
+
}
|
|
123
|
+
export { intern_1 as intern };
|
|
124
|
+
export namespace junior {
|
|
125
|
+
let min_1: number;
|
|
126
|
+
export { min_1 as min };
|
|
127
|
+
let max_1: number;
|
|
128
|
+
export { max_1 as max };
|
|
129
|
+
}
|
|
130
|
+
export namespace mid {
|
|
131
|
+
let min_2: number;
|
|
132
|
+
export { min_2 as min };
|
|
133
|
+
let max_2: number;
|
|
134
|
+
export { max_2 as max };
|
|
135
|
+
}
|
|
136
|
+
export namespace senior {
|
|
137
|
+
let min_3: number;
|
|
138
|
+
export { min_3 as min };
|
|
139
|
+
let max_3: number;
|
|
140
|
+
export { max_3 as max };
|
|
141
|
+
}
|
|
142
|
+
export namespace lead {
|
|
143
|
+
let min_4: number;
|
|
144
|
+
export { min_4 as min };
|
|
145
|
+
let max_4: number;
|
|
146
|
+
export { max_4 as max };
|
|
147
|
+
}
|
|
148
|
+
export namespace executive {
|
|
149
|
+
let min_5: number;
|
|
150
|
+
export { min_5 as min };
|
|
151
|
+
let max_5: number;
|
|
152
|
+
export { max_5 as max };
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
export namespace TAX_BRACKETS {
|
|
156
|
+
let BDT: {
|
|
157
|
+
min: number;
|
|
158
|
+
max: number;
|
|
159
|
+
rate: number;
|
|
160
|
+
}[];
|
|
161
|
+
}
|
|
162
|
+
export default HRM_CONFIG;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export function updateSalary({ EmployeeModel, employeeId, compensation, effectiveFrom, context, session }: {
|
|
2
|
+
EmployeeModel: any;
|
|
3
|
+
employeeId: any;
|
|
4
|
+
compensation?: {};
|
|
5
|
+
effectiveFrom?: Date;
|
|
6
|
+
context?: {};
|
|
7
|
+
session?: any;
|
|
8
|
+
}): Promise<any>;
|
|
9
|
+
export function addAllowance({ EmployeeModel, employeeId, type, amount, taxable, recurring, effectiveFrom, effectiveTo, context, session }: {
|
|
10
|
+
EmployeeModel: any;
|
|
11
|
+
employeeId: any;
|
|
12
|
+
type: any;
|
|
13
|
+
amount: any;
|
|
14
|
+
taxable?: boolean;
|
|
15
|
+
recurring?: boolean;
|
|
16
|
+
effectiveFrom?: Date;
|
|
17
|
+
effectiveTo?: any;
|
|
18
|
+
context?: {};
|
|
19
|
+
session?: any;
|
|
20
|
+
}): Promise<any>;
|
|
21
|
+
export function removeAllowance({ EmployeeModel, employeeId, type, context, session }: {
|
|
22
|
+
EmployeeModel: any;
|
|
23
|
+
employeeId: any;
|
|
24
|
+
type: any;
|
|
25
|
+
context?: {};
|
|
26
|
+
session?: any;
|
|
27
|
+
}): Promise<any>;
|
|
28
|
+
export function addDeduction({ EmployeeModel, employeeId, type, amount, auto, recurring, description, effectiveFrom, effectiveTo, context, session }: {
|
|
29
|
+
EmployeeModel: any;
|
|
30
|
+
employeeId: any;
|
|
31
|
+
type: any;
|
|
32
|
+
amount: any;
|
|
33
|
+
auto?: boolean;
|
|
34
|
+
recurring?: boolean;
|
|
35
|
+
description?: string;
|
|
36
|
+
effectiveFrom?: Date;
|
|
37
|
+
effectiveTo?: any;
|
|
38
|
+
context?: {};
|
|
39
|
+
session?: any;
|
|
40
|
+
}): Promise<any>;
|
|
41
|
+
export function removeDeduction({ EmployeeModel, employeeId, type, context, session }: {
|
|
42
|
+
EmployeeModel: any;
|
|
43
|
+
employeeId: any;
|
|
44
|
+
type: any;
|
|
45
|
+
context?: {};
|
|
46
|
+
session?: any;
|
|
47
|
+
}): Promise<any>;
|
|
48
|
+
export function updateBankDetails({ EmployeeModel, employeeId, bankDetails, context, session }: {
|
|
49
|
+
EmployeeModel: any;
|
|
50
|
+
employeeId: any;
|
|
51
|
+
bankDetails?: {};
|
|
52
|
+
context?: {};
|
|
53
|
+
session?: any;
|
|
54
|
+
}): Promise<any>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function hireEmployee({ EmployeeModel, organizationId, userId, employment, compensation, bankDetails, context, session }: {
|
|
2
|
+
EmployeeModel: any;
|
|
3
|
+
organizationId: any;
|
|
4
|
+
userId: any;
|
|
5
|
+
employment?: {};
|
|
6
|
+
compensation?: {};
|
|
7
|
+
bankDetails?: {};
|
|
8
|
+
context?: {};
|
|
9
|
+
session?: any;
|
|
10
|
+
}): Promise<any>;
|
|
11
|
+
export function updateEmployment({ EmployeeModel, employeeId, updates, context, session }: {
|
|
12
|
+
EmployeeModel: any;
|
|
13
|
+
employeeId: any;
|
|
14
|
+
updates?: {};
|
|
15
|
+
context?: {};
|
|
16
|
+
session?: any;
|
|
17
|
+
}): Promise<any>;
|
|
18
|
+
export function terminateEmployee({ EmployeeModel, employeeId, terminationDate, reason, notes, context, session }: {
|
|
19
|
+
EmployeeModel: any;
|
|
20
|
+
employeeId: any;
|
|
21
|
+
terminationDate?: Date;
|
|
22
|
+
reason?: string;
|
|
23
|
+
notes?: string;
|
|
24
|
+
context?: {};
|
|
25
|
+
session?: any;
|
|
26
|
+
}): Promise<any>;
|
|
27
|
+
export function reHireEmployee({ EmployeeModel, employeeId, hireDate, position, department, compensation, context, session }: {
|
|
28
|
+
EmployeeModel: any;
|
|
29
|
+
employeeId: any;
|
|
30
|
+
hireDate?: Date;
|
|
31
|
+
position?: any;
|
|
32
|
+
department?: any;
|
|
33
|
+
compensation?: any;
|
|
34
|
+
context?: {};
|
|
35
|
+
session?: any;
|
|
36
|
+
}): Promise<any>;
|
|
37
|
+
export function getEmployeeList({ EmployeeModel, organizationId, filters, pagination, session }: {
|
|
38
|
+
EmployeeModel: any;
|
|
39
|
+
organizationId: any;
|
|
40
|
+
filters?: {};
|
|
41
|
+
pagination?: {};
|
|
42
|
+
session?: any;
|
|
43
|
+
}): Promise<any>;
|
|
44
|
+
export function getEmployeeById({ EmployeeModel, employeeId, populateUser, session }: {
|
|
45
|
+
EmployeeModel: any;
|
|
46
|
+
employeeId: any;
|
|
47
|
+
populateUser?: boolean;
|
|
48
|
+
session?: any;
|
|
49
|
+
}): Promise<any>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export function processSalary({ EmployeeModel, PayrollRecordModel, TransactionModel, AttendanceModel, employeeId, month, year, paymentDate, paymentMethod, context, session }: {
|
|
2
|
+
EmployeeModel: any;
|
|
3
|
+
PayrollRecordModel: any;
|
|
4
|
+
TransactionModel: any;
|
|
5
|
+
AttendanceModel?: any;
|
|
6
|
+
employeeId: any;
|
|
7
|
+
month: any;
|
|
8
|
+
year: any;
|
|
9
|
+
paymentDate?: Date;
|
|
10
|
+
paymentMethod?: string;
|
|
11
|
+
context?: {};
|
|
12
|
+
session?: any;
|
|
13
|
+
}): Promise<{
|
|
14
|
+
payrollRecord: any;
|
|
15
|
+
transaction: any;
|
|
16
|
+
employee: any;
|
|
17
|
+
}>;
|
|
18
|
+
export function processBulkPayroll({ EmployeeModel, PayrollRecordModel, TransactionModel, AttendanceModel, organizationId, month, year, employeeIds, paymentDate, paymentMethod, context, session: providedSession }: {
|
|
19
|
+
EmployeeModel: any;
|
|
20
|
+
PayrollRecordModel: any;
|
|
21
|
+
TransactionModel: any;
|
|
22
|
+
AttendanceModel?: any;
|
|
23
|
+
organizationId: any;
|
|
24
|
+
month: any;
|
|
25
|
+
year: any;
|
|
26
|
+
employeeIds?: any[];
|
|
27
|
+
paymentDate?: Date;
|
|
28
|
+
paymentMethod?: string;
|
|
29
|
+
context?: {};
|
|
30
|
+
session?: any;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
successful: any[];
|
|
33
|
+
failed: any[];
|
|
34
|
+
total: any;
|
|
35
|
+
}>;
|
|
36
|
+
export function getPayrollHistory({ PayrollRecordModel, employeeId, organizationId, month, year, status, pagination, session }: {
|
|
37
|
+
PayrollRecordModel: any;
|
|
38
|
+
employeeId?: any;
|
|
39
|
+
organizationId?: any;
|
|
40
|
+
month?: any;
|
|
41
|
+
year?: any;
|
|
42
|
+
status?: any;
|
|
43
|
+
pagination?: {};
|
|
44
|
+
session?: any;
|
|
45
|
+
}): Promise<any>;
|
|
46
|
+
export function getPayrollSummary({ PayrollRecordModel, organizationId, month, year, session }: {
|
|
47
|
+
PayrollRecordModel: any;
|
|
48
|
+
organizationId: any;
|
|
49
|
+
month?: any;
|
|
50
|
+
year?: any;
|
|
51
|
+
session?: any;
|
|
52
|
+
}): Promise<any>;
|
|
53
|
+
export function exportPayrollData({ PayrollRecordModel, organizationId, startDate, endDate, format, session }: {
|
|
54
|
+
PayrollRecordModel: any;
|
|
55
|
+
organizationId: any;
|
|
56
|
+
startDate: any;
|
|
57
|
+
endDate: any;
|
|
58
|
+
format?: string;
|
|
59
|
+
session?: any;
|
|
60
|
+
}): Promise<any>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if category is HRM-managed (created by HRM workflows only)
|
|
3
|
+
*/
|
|
4
|
+
export function isHRMManagedCategory(category: any): boolean;
|
|
5
|
+
export namespace EMPLOYMENT_TYPE {
|
|
6
|
+
let FULL_TIME: string;
|
|
7
|
+
let PART_TIME: string;
|
|
8
|
+
let CONTRACT: string;
|
|
9
|
+
let INTERN: string;
|
|
10
|
+
let CONSULTANT: string;
|
|
11
|
+
}
|
|
12
|
+
export const EMPLOYMENT_TYPE_VALUES: string[];
|
|
13
|
+
export namespace EMPLOYEE_STATUS {
|
|
14
|
+
let ACTIVE: string;
|
|
15
|
+
let ON_LEAVE: string;
|
|
16
|
+
let SUSPENDED: string;
|
|
17
|
+
let TERMINATED: string;
|
|
18
|
+
}
|
|
19
|
+
export const EMPLOYEE_STATUS_VALUES: string[];
|
|
20
|
+
export namespace DEPARTMENT {
|
|
21
|
+
let MANAGEMENT: string;
|
|
22
|
+
let TRAINING: string;
|
|
23
|
+
let SALES: string;
|
|
24
|
+
let OPERATIONS: string;
|
|
25
|
+
let SUPPORT: string;
|
|
26
|
+
let HR: string;
|
|
27
|
+
let MAINTENANCE: string;
|
|
28
|
+
let MARKETING: string;
|
|
29
|
+
}
|
|
30
|
+
export const DEPARTMENT_VALUES: string[];
|
|
31
|
+
export namespace PAYMENT_FREQUENCY {
|
|
32
|
+
let MONTHLY: string;
|
|
33
|
+
let BI_WEEKLY: string;
|
|
34
|
+
let WEEKLY: string;
|
|
35
|
+
let HOURLY: string;
|
|
36
|
+
let DAILY: string;
|
|
37
|
+
}
|
|
38
|
+
export const PAYMENT_FREQUENCY_VALUES: string[];
|
|
39
|
+
export namespace ALLOWANCE_TYPE {
|
|
40
|
+
let HOUSING: string;
|
|
41
|
+
let TRANSPORT: string;
|
|
42
|
+
let MEAL: string;
|
|
43
|
+
let MOBILE: string;
|
|
44
|
+
let MEDICAL: string;
|
|
45
|
+
let EDUCATION: string;
|
|
46
|
+
let OTHER: string;
|
|
47
|
+
}
|
|
48
|
+
export const ALLOWANCE_TYPE_VALUES: string[];
|
|
49
|
+
export namespace DEDUCTION_TYPE {
|
|
50
|
+
export let TAX: string;
|
|
51
|
+
export let LOAN: string;
|
|
52
|
+
export let ADVANCE: string;
|
|
53
|
+
export let PROVIDENT_FUND: string;
|
|
54
|
+
export let INSURANCE: string;
|
|
55
|
+
export let ABSENCE: string;
|
|
56
|
+
let OTHER_1: string;
|
|
57
|
+
export { OTHER_1 as OTHER };
|
|
58
|
+
}
|
|
59
|
+
export const DEDUCTION_TYPE_VALUES: string[];
|
|
60
|
+
export namespace PAYROLL_STATUS {
|
|
61
|
+
let PENDING: string;
|
|
62
|
+
let PROCESSING: string;
|
|
63
|
+
let PAID: string;
|
|
64
|
+
let FAILED: string;
|
|
65
|
+
let CANCELLED: string;
|
|
66
|
+
}
|
|
67
|
+
export const PAYROLL_STATUS_VALUES: string[];
|
|
68
|
+
export namespace TERMINATION_REASON {
|
|
69
|
+
export let RESIGNATION: string;
|
|
70
|
+
export let RETIREMENT: string;
|
|
71
|
+
export let TERMINATION: string;
|
|
72
|
+
export let CONTRACT_END: string;
|
|
73
|
+
export let MUTUAL_AGREEMENT: string;
|
|
74
|
+
let OTHER_2: string;
|
|
75
|
+
export { OTHER_2 as OTHER };
|
|
76
|
+
}
|
|
77
|
+
export const TERMINATION_REASON_VALUES: string[];
|
|
78
|
+
export namespace PAYMENT_METHOD {
|
|
79
|
+
let BANK: string;
|
|
80
|
+
let CASH: string;
|
|
81
|
+
let BKASH: string;
|
|
82
|
+
let NAGAD: string;
|
|
83
|
+
let ROCKET: string;
|
|
84
|
+
}
|
|
85
|
+
export const PAYMENT_METHOD_VALUES: string[];
|
|
86
|
+
export namespace HRM_TRANSACTION_CATEGORIES {
|
|
87
|
+
let SALARY: string;
|
|
88
|
+
let BONUS: string;
|
|
89
|
+
let COMMISSION: string;
|
|
90
|
+
let OVERTIME: string;
|
|
91
|
+
let SEVERANCE: string;
|
|
92
|
+
}
|
|
93
|
+
export const HRM_CATEGORY_VALUES: string[];
|
|
94
|
+
declare namespace _default {
|
|
95
|
+
export { EMPLOYMENT_TYPE };
|
|
96
|
+
export { EMPLOYMENT_TYPE_VALUES };
|
|
97
|
+
export { EMPLOYEE_STATUS };
|
|
98
|
+
export { EMPLOYEE_STATUS_VALUES };
|
|
99
|
+
export { DEPARTMENT };
|
|
100
|
+
export { DEPARTMENT_VALUES };
|
|
101
|
+
export { PAYMENT_FREQUENCY };
|
|
102
|
+
export { PAYMENT_FREQUENCY_VALUES };
|
|
103
|
+
export { PAYMENT_METHOD };
|
|
104
|
+
export { PAYMENT_METHOD_VALUES };
|
|
105
|
+
export { ALLOWANCE_TYPE };
|
|
106
|
+
export { ALLOWANCE_TYPE_VALUES };
|
|
107
|
+
export { DEDUCTION_TYPE };
|
|
108
|
+
export { DEDUCTION_TYPE_VALUES };
|
|
109
|
+
export { PAYROLL_STATUS };
|
|
110
|
+
export { PAYROLL_STATUS_VALUES };
|
|
111
|
+
export { TERMINATION_REASON };
|
|
112
|
+
export { TERMINATION_REASON_VALUES };
|
|
113
|
+
export { HRM_TRANSACTION_CATEGORIES };
|
|
114
|
+
export { HRM_CATEGORY_VALUES };
|
|
115
|
+
export { isHRMManagedCategory };
|
|
116
|
+
}
|
|
117
|
+
export default _default;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
export class CompensationFactory {
|
|
2
|
+
static create({ baseAmount, frequency, currency, allowances, deductions, effectiveFrom, }: {
|
|
3
|
+
baseAmount: any;
|
|
4
|
+
frequency?: string;
|
|
5
|
+
currency?: string;
|
|
6
|
+
allowances?: any[];
|
|
7
|
+
deductions?: any[];
|
|
8
|
+
effectiveFrom?: Date;
|
|
9
|
+
}): {
|
|
10
|
+
baseAmount: any;
|
|
11
|
+
frequency: string;
|
|
12
|
+
currency: string;
|
|
13
|
+
allowances: {
|
|
14
|
+
type: any;
|
|
15
|
+
name: any;
|
|
16
|
+
value: any;
|
|
17
|
+
isPercentage: boolean;
|
|
18
|
+
}[];
|
|
19
|
+
deductions: {
|
|
20
|
+
type: any;
|
|
21
|
+
name: any;
|
|
22
|
+
value: any;
|
|
23
|
+
isPercentage: boolean;
|
|
24
|
+
}[];
|
|
25
|
+
effectiveFrom: Date;
|
|
26
|
+
lastUpdated: Date;
|
|
27
|
+
};
|
|
28
|
+
static createAllowance({ type, name, value, isPercentage }: {
|
|
29
|
+
type: any;
|
|
30
|
+
name: any;
|
|
31
|
+
value: any;
|
|
32
|
+
isPercentage?: boolean;
|
|
33
|
+
}): {
|
|
34
|
+
type: any;
|
|
35
|
+
name: any;
|
|
36
|
+
value: any;
|
|
37
|
+
isPercentage: boolean;
|
|
38
|
+
};
|
|
39
|
+
static createDeduction({ type, name, value, isPercentage }: {
|
|
40
|
+
type: any;
|
|
41
|
+
name: any;
|
|
42
|
+
value: any;
|
|
43
|
+
isPercentage?: boolean;
|
|
44
|
+
}): {
|
|
45
|
+
type: any;
|
|
46
|
+
name: any;
|
|
47
|
+
value: any;
|
|
48
|
+
isPercentage: boolean;
|
|
49
|
+
};
|
|
50
|
+
static updateBaseAmount(compensation: any, newAmount: any, effectiveFrom?: Date): any;
|
|
51
|
+
static addAllowance(compensation: any, allowance: any): any;
|
|
52
|
+
static removeAllowance(compensation: any, allowanceType: any): any;
|
|
53
|
+
static addDeduction(compensation: any, deduction: any): any;
|
|
54
|
+
static removeDeduction(compensation: any, deductionType: any): any;
|
|
55
|
+
static calculateBreakdown(compensation: any): {
|
|
56
|
+
baseAmount: any;
|
|
57
|
+
allowances: any;
|
|
58
|
+
deductions: any;
|
|
59
|
+
grossAmount: any;
|
|
60
|
+
netAmount: number;
|
|
61
|
+
};
|
|
62
|
+
static applyIncrement(compensation: any, { percentage, amount, effectiveFrom }: {
|
|
63
|
+
percentage: any;
|
|
64
|
+
amount: any;
|
|
65
|
+
effectiveFrom?: Date;
|
|
66
|
+
}): any;
|
|
67
|
+
}
|
|
68
|
+
export class CompensationBuilder {
|
|
69
|
+
data: {
|
|
70
|
+
allowances: any[];
|
|
71
|
+
deductions: any[];
|
|
72
|
+
frequency: string;
|
|
73
|
+
currency: string;
|
|
74
|
+
};
|
|
75
|
+
withBase(amount: any, frequency?: string, currency?: string): this;
|
|
76
|
+
addAllowance(type: any, value: any, isPercentage?: boolean, name?: any): this;
|
|
77
|
+
addDeduction(type: any, value: any, isPercentage?: boolean, name?: any): this;
|
|
78
|
+
effectiveFrom(date: any): this;
|
|
79
|
+
build(): {
|
|
80
|
+
baseAmount: any;
|
|
81
|
+
frequency: string;
|
|
82
|
+
currency: string;
|
|
83
|
+
allowances: {
|
|
84
|
+
type: any;
|
|
85
|
+
name: any;
|
|
86
|
+
value: any;
|
|
87
|
+
isPercentage: boolean;
|
|
88
|
+
}[];
|
|
89
|
+
deductions: {
|
|
90
|
+
type: any;
|
|
91
|
+
name: any;
|
|
92
|
+
value: any;
|
|
93
|
+
isPercentage: boolean;
|
|
94
|
+
}[];
|
|
95
|
+
effectiveFrom: Date;
|
|
96
|
+
lastUpdated: Date;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export function createCompensation(): CompensationBuilder;
|
|
100
|
+
export namespace CompensationPresets {
|
|
101
|
+
function basic(baseAmount: any): {
|
|
102
|
+
baseAmount: any;
|
|
103
|
+
frequency: string;
|
|
104
|
+
currency: string;
|
|
105
|
+
allowances: {
|
|
106
|
+
type: any;
|
|
107
|
+
name: any;
|
|
108
|
+
value: any;
|
|
109
|
+
isPercentage: boolean;
|
|
110
|
+
}[];
|
|
111
|
+
deductions: {
|
|
112
|
+
type: any;
|
|
113
|
+
name: any;
|
|
114
|
+
value: any;
|
|
115
|
+
isPercentage: boolean;
|
|
116
|
+
}[];
|
|
117
|
+
effectiveFrom: Date;
|
|
118
|
+
lastUpdated: Date;
|
|
119
|
+
};
|
|
120
|
+
function withHouseRent(baseAmount: any, rentPercentage?: number): {
|
|
121
|
+
baseAmount: any;
|
|
122
|
+
frequency: string;
|
|
123
|
+
currency: string;
|
|
124
|
+
allowances: {
|
|
125
|
+
type: any;
|
|
126
|
+
name: any;
|
|
127
|
+
value: any;
|
|
128
|
+
isPercentage: boolean;
|
|
129
|
+
}[];
|
|
130
|
+
deductions: {
|
|
131
|
+
type: any;
|
|
132
|
+
name: any;
|
|
133
|
+
value: any;
|
|
134
|
+
isPercentage: boolean;
|
|
135
|
+
}[];
|
|
136
|
+
effectiveFrom: Date;
|
|
137
|
+
lastUpdated: Date;
|
|
138
|
+
};
|
|
139
|
+
function withMedical(baseAmount: any, medicalPercentage?: number): {
|
|
140
|
+
baseAmount: any;
|
|
141
|
+
frequency: string;
|
|
142
|
+
currency: string;
|
|
143
|
+
allowances: {
|
|
144
|
+
type: any;
|
|
145
|
+
name: any;
|
|
146
|
+
value: any;
|
|
147
|
+
isPercentage: boolean;
|
|
148
|
+
}[];
|
|
149
|
+
deductions: {
|
|
150
|
+
type: any;
|
|
151
|
+
name: any;
|
|
152
|
+
value: any;
|
|
153
|
+
isPercentage: boolean;
|
|
154
|
+
}[];
|
|
155
|
+
effectiveFrom: Date;
|
|
156
|
+
lastUpdated: Date;
|
|
157
|
+
};
|
|
158
|
+
function standard(baseAmount: any): {
|
|
159
|
+
baseAmount: any;
|
|
160
|
+
frequency: string;
|
|
161
|
+
currency: string;
|
|
162
|
+
allowances: {
|
|
163
|
+
type: any;
|
|
164
|
+
name: any;
|
|
165
|
+
value: any;
|
|
166
|
+
isPercentage: boolean;
|
|
167
|
+
}[];
|
|
168
|
+
deductions: {
|
|
169
|
+
type: any;
|
|
170
|
+
name: any;
|
|
171
|
+
value: any;
|
|
172
|
+
isPercentage: boolean;
|
|
173
|
+
}[];
|
|
174
|
+
effectiveFrom: Date;
|
|
175
|
+
lastUpdated: Date;
|
|
176
|
+
};
|
|
177
|
+
function withProvidentFund(baseAmount: any, pfPercentage?: number): {
|
|
178
|
+
baseAmount: any;
|
|
179
|
+
frequency: string;
|
|
180
|
+
currency: string;
|
|
181
|
+
allowances: {
|
|
182
|
+
type: any;
|
|
183
|
+
name: any;
|
|
184
|
+
value: any;
|
|
185
|
+
isPercentage: boolean;
|
|
186
|
+
}[];
|
|
187
|
+
deductions: {
|
|
188
|
+
type: any;
|
|
189
|
+
name: any;
|
|
190
|
+
value: any;
|
|
191
|
+
isPercentage: boolean;
|
|
192
|
+
}[];
|
|
193
|
+
effectiveFrom: Date;
|
|
194
|
+
lastUpdated: Date;
|
|
195
|
+
};
|
|
196
|
+
}
|