@classytic/payroll 1.0.2 → 2.3.0

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.

Files changed (78) hide show
  1. package/README.md +2599 -574
  2. package/dist/calculators/index.d.ts +433 -0
  3. package/dist/calculators/index.js +283 -0
  4. package/dist/calculators/index.js.map +1 -0
  5. package/dist/core/index.d.ts +314 -0
  6. package/dist/core/index.js +1166 -0
  7. package/dist/core/index.js.map +1 -0
  8. package/dist/employee-identity-DXhgOgXE.d.ts +473 -0
  9. package/dist/employee.factory-BlZqhiCk.d.ts +189 -0
  10. package/dist/idempotency-Cw2CWicb.d.ts +52 -0
  11. package/dist/index.d.ts +902 -0
  12. package/dist/index.js +9108 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/jurisdiction/index.d.ts +660 -0
  15. package/dist/jurisdiction/index.js +533 -0
  16. package/dist/jurisdiction/index.js.map +1 -0
  17. package/dist/payroll.d.ts +429 -0
  18. package/dist/payroll.js +5192 -0
  19. package/dist/payroll.js.map +1 -0
  20. package/dist/schemas/index.d.ts +3262 -0
  21. package/dist/schemas/index.js +780 -0
  22. package/dist/schemas/index.js.map +1 -0
  23. package/dist/services/index.d.ts +582 -0
  24. package/dist/services/index.js +2172 -0
  25. package/dist/services/index.js.map +1 -0
  26. package/dist/shift-compliance/index.d.ts +1171 -0
  27. package/dist/shift-compliance/index.js +1479 -0
  28. package/dist/shift-compliance/index.js.map +1 -0
  29. package/dist/types-BN3K_Uhr.d.ts +1842 -0
  30. package/dist/utils/index.d.ts +893 -0
  31. package/dist/utils/index.js +1515 -0
  32. package/dist/utils/index.js.map +1 -0
  33. package/package.json +72 -37
  34. package/dist/types/config.d.ts +0 -162
  35. package/dist/types/core/compensation.manager.d.ts +0 -54
  36. package/dist/types/core/employment.manager.d.ts +0 -49
  37. package/dist/types/core/payroll.manager.d.ts +0 -60
  38. package/dist/types/enums.d.ts +0 -117
  39. package/dist/types/factories/compensation.factory.d.ts +0 -196
  40. package/dist/types/factories/employee.factory.d.ts +0 -149
  41. package/dist/types/factories/payroll.factory.d.ts +0 -319
  42. package/dist/types/hrm.orchestrator.d.ts +0 -47
  43. package/dist/types/index.d.ts +0 -20
  44. package/dist/types/init.d.ts +0 -30
  45. package/dist/types/models/payroll-record.model.d.ts +0 -3
  46. package/dist/types/plugins/employee.plugin.d.ts +0 -2
  47. package/dist/types/schemas/employment.schema.d.ts +0 -959
  48. package/dist/types/services/compensation.service.d.ts +0 -94
  49. package/dist/types/services/employee.service.d.ts +0 -28
  50. package/dist/types/services/payroll.service.d.ts +0 -30
  51. package/dist/types/utils/calculation.utils.d.ts +0 -26
  52. package/dist/types/utils/date.utils.d.ts +0 -35
  53. package/dist/types/utils/logger.d.ts +0 -12
  54. package/dist/types/utils/query-builders.d.ts +0 -83
  55. package/dist/types/utils/validation.utils.d.ts +0 -33
  56. package/payroll.d.ts +0 -241
  57. package/src/config.js +0 -177
  58. package/src/core/compensation.manager.js +0 -242
  59. package/src/core/employment.manager.js +0 -224
  60. package/src/core/payroll.manager.js +0 -499
  61. package/src/enums.js +0 -141
  62. package/src/factories/compensation.factory.js +0 -198
  63. package/src/factories/employee.factory.js +0 -173
  64. package/src/factories/payroll.factory.js +0 -413
  65. package/src/hrm.orchestrator.js +0 -139
  66. package/src/index.js +0 -172
  67. package/src/init.js +0 -62
  68. package/src/models/payroll-record.model.js +0 -126
  69. package/src/plugins/employee.plugin.js +0 -164
  70. package/src/schemas/employment.schema.js +0 -126
  71. package/src/services/compensation.service.js +0 -231
  72. package/src/services/employee.service.js +0 -162
  73. package/src/services/payroll.service.js +0 -213
  74. package/src/utils/calculation.utils.js +0 -91
  75. package/src/utils/date.utils.js +0 -120
  76. package/src/utils/logger.js +0 -36
  77. package/src/utils/query-builders.js +0 -185
  78. package/src/utils/validation.utils.js +0 -122
@@ -1,149 +0,0 @@
1
- export class EmployeeFactory {
2
- static create({ userId, organizationId, employment, compensation, bankDetails, }: {
3
- userId: any;
4
- organizationId: any;
5
- employment?: {};
6
- compensation?: {};
7
- bankDetails?: {};
8
- }): {
9
- userId: any;
10
- organizationId: any;
11
- employeeId: any;
12
- employmentType: any;
13
- status: string;
14
- department: any;
15
- position: any;
16
- hireDate: any;
17
- probationEndDate: Date;
18
- compensation: {
19
- baseAmount: any;
20
- frequency: string;
21
- currency: string;
22
- allowances: {
23
- type: any;
24
- name: any;
25
- amount: any;
26
- isPercentage: boolean;
27
- }[];
28
- deductions: {
29
- type: any;
30
- name: any;
31
- amount: any;
32
- isPercentage: boolean;
33
- }[];
34
- };
35
- workSchedule: any;
36
- bankDetails: {};
37
- };
38
- static createCompensation({ baseAmount, frequency, currency, allowances, deductions, }: {
39
- baseAmount: any;
40
- frequency?: string;
41
- currency?: string;
42
- allowances?: any[];
43
- deductions?: any[];
44
- }): {
45
- baseAmount: any;
46
- frequency: string;
47
- currency: string;
48
- allowances: {
49
- type: any;
50
- name: any;
51
- amount: any;
52
- isPercentage: boolean;
53
- }[];
54
- deductions: {
55
- type: any;
56
- name: any;
57
- amount: any;
58
- isPercentage: boolean;
59
- }[];
60
- };
61
- static createAllowance({ type, name, amount, isPercentage }: {
62
- type: any;
63
- name: any;
64
- amount: any;
65
- isPercentage?: boolean;
66
- }): {
67
- type: any;
68
- name: any;
69
- amount: any;
70
- isPercentage: boolean;
71
- };
72
- static createDeduction({ type, name, amount, isPercentage }: {
73
- type: any;
74
- name: any;
75
- amount: any;
76
- isPercentage?: boolean;
77
- }): {
78
- type: any;
79
- name: any;
80
- amount: any;
81
- isPercentage: boolean;
82
- };
83
- static defaultWorkSchedule(): {
84
- hoursPerWeek: number;
85
- daysPerWeek: number;
86
- workDays: string[];
87
- };
88
- static createTermination({ reason, date, notes, context }: {
89
- reason: any;
90
- date?: Date;
91
- notes: any;
92
- context?: {};
93
- }): {
94
- terminatedAt: Date;
95
- terminationReason: any;
96
- terminationNotes: any;
97
- terminatedBy: {
98
- userId: any;
99
- name: any;
100
- role: any;
101
- };
102
- };
103
- }
104
- export class EmployeeBuilder {
105
- data: {};
106
- forUser(userId: any): this;
107
- inOrganization(organizationId: any): this;
108
- withEmployeeId(employeeId: any): this;
109
- asDepartment(department: any): this;
110
- asPosition(position: any): this;
111
- withEmploymentType(type: any): this;
112
- hiredOn(date: any): this;
113
- withProbation(months: any): this;
114
- withBaseSalary(amount: any, frequency?: string, currency?: string): this;
115
- addAllowance(type: any, amount: any, name: any): this;
116
- addDeduction(type: any, amount: any, name: any): this;
117
- withBankDetails(bankDetails: any): this;
118
- build(): {
119
- userId: any;
120
- organizationId: any;
121
- employeeId: any;
122
- employmentType: any;
123
- status: string;
124
- department: any;
125
- position: any;
126
- hireDate: any;
127
- probationEndDate: Date;
128
- compensation: {
129
- baseAmount: any;
130
- frequency: string;
131
- currency: string;
132
- allowances: {
133
- type: any;
134
- name: any;
135
- amount: any;
136
- isPercentage: boolean;
137
- }[];
138
- deductions: {
139
- type: any;
140
- name: any;
141
- amount: any;
142
- isPercentage: boolean;
143
- }[];
144
- };
145
- workSchedule: any;
146
- bankDetails: {};
147
- };
148
- }
149
- export function createEmployee(): EmployeeBuilder;
@@ -1,319 +0,0 @@
1
- /**
2
- * @typedef {Object} AllowanceInput
3
- * @property {string} type - Type of allowance
4
- * @property {string} [name] - Display name for the allowance
5
- * @property {number} value - Allowance value (amount or percentage)
6
- * @property {boolean} [isPercentage=false] - Whether value is a percentage
7
- */
8
- /**
9
- * @typedef {Object} DeductionInput
10
- * @property {string} type - Type of deduction
11
- * @property {string} [name] - Display name for the deduction
12
- * @property {number} value - Deduction value (amount or percentage)
13
- * @property {boolean} [isPercentage=false] - Whether value is a percentage
14
- */
15
- /**
16
- * @typedef {Object} PeriodInput
17
- * @property {number} [month] - Month (1-12)
18
- * @property {number} [year] - Year
19
- */
20
- /**
21
- * @typedef {Object} PayrollMetadata
22
- * @property {string} [currency='BDT'] - Currency code
23
- * @property {string} [paymentMethod] - Payment method
24
- * @property {string} [notes] - Additional notes
25
- */
26
- /**
27
- * @typedef {Object} PayrollRecord
28
- * @property {string} employeeId - Employee identifier
29
- * @property {string} organizationId - Organization identifier
30
- * @property {Object} period - Pay period information
31
- * @property {Object} breakdown - Salary breakdown
32
- * @property {number} breakdown.baseAmount - Base salary amount
33
- * @property {Array} breakdown.allowances - Calculated allowances
34
- * @property {Array} breakdown.deductions - Calculated deductions
35
- * @property {number} breakdown.grossSalary - Gross salary
36
- * @property {number} breakdown.netSalary - Net salary after deductions
37
- * @property {string} status - Payroll status ('pending', 'processed', 'paid')
38
- * @property {Date|null} processedAt - When payroll was processed
39
- * @property {Date|null} paidAt - When payment was made
40
- * @property {PayrollMetadata} metadata - Additional metadata
41
- */
42
- export class PayrollFactory {
43
- /**
44
- * Create a new payroll record
45
- *
46
- * @param {Object} params - Payroll parameters
47
- * @param {string} params.employeeId - Employee ID
48
- * @param {string} params.organizationId - Organization ID
49
- * @param {number} params.baseAmount - Base salary amount
50
- * @param {AllowanceInput[]} [params.allowances=[]] - Allowances array
51
- * @param {DeductionInput[]} [params.deductions=[]] - Deductions array
52
- * @param {PeriodInput} [params.period={}] - Pay period
53
- * @param {PayrollMetadata} [params.metadata={}] - Additional metadata
54
- * @returns {PayrollRecord} Payroll record object
55
- */
56
- static create({ employeeId, organizationId, baseAmount, allowances, deductions, period, metadata, }: {
57
- employeeId: string;
58
- organizationId: string;
59
- baseAmount: number;
60
- allowances?: AllowanceInput[];
61
- deductions?: DeductionInput[];
62
- period?: PeriodInput;
63
- metadata?: PayrollMetadata;
64
- }): PayrollRecord;
65
- /**
66
- * Create a pay period object
67
- *
68
- * @param {PeriodInput} [params={}] - Period parameters
69
- * @param {number} [params.month] - Month (defaults to current month)
70
- * @param {number} [params.year] - Year (defaults to current year)
71
- * @returns {Object} Pay period object with startDate, endDate, etc.
72
- */
73
- static createPeriod({ month, year }?: PeriodInput): any;
74
- /**
75
- * Calculate allowances from base amount and allowance inputs
76
- *
77
- * @param {number} baseAmount - Base salary amount
78
- * @param {AllowanceInput[]} allowances - Array of allowances
79
- * @returns {Array} Calculated allowances with amounts
80
- */
81
- static calculateAllowances(baseAmount: number, allowances: AllowanceInput[]): any[];
82
- /**
83
- * Calculate deductions from base amount and deduction inputs
84
- *
85
- * @param {number} baseAmount - Base salary amount
86
- * @param {DeductionInput[]} deductions - Array of deductions
87
- * @returns {Array} Calculated deductions with amounts
88
- */
89
- static calculateDeductions(baseAmount: number, deductions: DeductionInput[]): any[];
90
- /**
91
- * Create a bonus object
92
- *
93
- * @param {Object} params - Bonus parameters
94
- * @param {string} params.type - Bonus type
95
- * @param {number} params.amount - Bonus amount
96
- * @param {string} params.reason - Reason for bonus
97
- * @param {string} params.approvedBy - User who approved the bonus
98
- * @returns {Object} Bonus object
99
- */
100
- static createBonus({ type, amount, reason, approvedBy }: {
101
- type: string;
102
- amount: number;
103
- reason: string;
104
- approvedBy: string;
105
- }): any;
106
- /**
107
- * Create a deduction object
108
- *
109
- * @param {Object} params - Deduction parameters
110
- * @param {string} params.type - Deduction type
111
- * @param {number} params.amount - Deduction amount
112
- * @param {string} params.reason - Reason for deduction
113
- * @param {string} params.appliedBy - User who applied the deduction
114
- * @returns {Object} Deduction object
115
- */
116
- static createDeduction({ type, amount, reason, appliedBy }: {
117
- type: string;
118
- amount: number;
119
- reason: string;
120
- appliedBy: string;
121
- }): any;
122
- /**
123
- * Mark a payroll record as paid (immutable - returns new object)
124
- *
125
- * @param {PayrollRecord} payroll - Payroll record to mark as paid
126
- * @param {Object} [params={}] - Payment details
127
- * @param {Date} [params.paidAt] - Payment date (defaults to now)
128
- * @param {string} [params.transactionId] - Transaction ID
129
- * @param {string} [params.paymentMethod] - Payment method
130
- * @returns {PayrollRecord} New payroll record marked as paid
131
- */
132
- static markAsPaid(payroll: PayrollRecord, { paidAt, transactionId, paymentMethod }?: {
133
- paidAt?: Date;
134
- transactionId?: string;
135
- paymentMethod?: string;
136
- }): PayrollRecord;
137
- /**
138
- * Mark a payroll record as processed (immutable - returns new object)
139
- *
140
- * @param {PayrollRecord} payroll - Payroll record to mark as processed
141
- * @param {Object} [params={}] - Processing details
142
- * @param {Date} [params.processedAt] - Processing date (defaults to now)
143
- * @returns {PayrollRecord} New payroll record marked as processed
144
- */
145
- static markAsProcessed(payroll: PayrollRecord, { processedAt }?: {
146
- processedAt?: Date;
147
- }): PayrollRecord;
148
- }
149
- /**
150
- * PayrollBuilder - Fluent builder pattern for creating payroll records
151
- *
152
- * @example
153
- * const payroll = createPayroll()
154
- * .forEmployee('emp-123')
155
- * .inOrganization('org-456')
156
- * .withBaseAmount(50000)
157
- * .addAllowance('housing', 10000)
158
- * .addDeduction('tax', 15, true)
159
- * .build();
160
- */
161
- export class PayrollBuilder {
162
- data: {
163
- allowances: any[];
164
- deductions: any[];
165
- period: {};
166
- metadata: {};
167
- };
168
- forEmployee(employeeId: any): this;
169
- inOrganization(organizationId: any): this;
170
- withBaseAmount(amount: any): this;
171
- forPeriod(month: any, year: any): this;
172
- addAllowance(type: any, value: any, isPercentage?: boolean, name?: any): this;
173
- addDeduction(type: any, value: any, isPercentage?: boolean, name?: any): this;
174
- addBonus(amount: any, reason: any, approvedBy: any): this;
175
- withCurrency(currency: any): this;
176
- withPaymentMethod(method: any): this;
177
- withNotes(notes: any): this;
178
- build(): PayrollRecord;
179
- }
180
- export function createPayroll(): PayrollBuilder;
181
- /**
182
- * BatchPayrollFactory - Process payroll for multiple employees at once
183
- *
184
- * @example
185
- * const payrolls = BatchPayrollFactory.createBatch(employees, {
186
- * month: 1,
187
- * year: 2025,
188
- * organizationId: 'org-123'
189
- * });
190
- */
191
- export class BatchPayrollFactory {
192
- /**
193
- * Create payroll records for multiple employees
194
- *
195
- * @param {Array} employees - Array of employee objects
196
- * @param {Object} params - Batch parameters
197
- * @param {number} params.month - Month for payroll
198
- * @param {number} params.year - Year for payroll
199
- * @param {string} params.organizationId - Organization ID
200
- * @returns {PayrollRecord[]} Array of payroll records
201
- */
202
- static createBatch(employees: any[], { month, year, organizationId }: {
203
- month: number;
204
- year: number;
205
- organizationId: string;
206
- }): PayrollRecord[];
207
- /**
208
- * Calculate total payroll amounts across multiple records
209
- *
210
- * @param {PayrollRecord[]} payrolls - Array of payroll records
211
- * @returns {Object} Totals summary
212
- * @returns {number} return.count - Total number of payrolls
213
- * @returns {number} return.totalGross - Sum of gross salaries
214
- * @returns {number} return.totalNet - Sum of net salaries
215
- * @returns {number} return.totalAllowances - Sum of all allowances
216
- * @returns {number} return.totalDeductions - Sum of all deductions
217
- */
218
- static calculateTotalPayroll(payrolls: PayrollRecord[]): any;
219
- }
220
- export type AllowanceInput = {
221
- /**
222
- * - Type of allowance
223
- */
224
- type: string;
225
- /**
226
- * - Display name for the allowance
227
- */
228
- name?: string;
229
- /**
230
- * - Allowance value (amount or percentage)
231
- */
232
- value: number;
233
- /**
234
- * - Whether value is a percentage
235
- */
236
- isPercentage?: boolean;
237
- };
238
- export type DeductionInput = {
239
- /**
240
- * - Type of deduction
241
- */
242
- type: string;
243
- /**
244
- * - Display name for the deduction
245
- */
246
- name?: string;
247
- /**
248
- * - Deduction value (amount or percentage)
249
- */
250
- value: number;
251
- /**
252
- * - Whether value is a percentage
253
- */
254
- isPercentage?: boolean;
255
- };
256
- export type PeriodInput = {
257
- /**
258
- * - Month (1-12)
259
- */
260
- month?: number;
261
- /**
262
- * - Year
263
- */
264
- year?: number;
265
- };
266
- export type PayrollMetadata = {
267
- /**
268
- * - Currency code
269
- */
270
- currency?: string;
271
- /**
272
- * - Payment method
273
- */
274
- paymentMethod?: string;
275
- /**
276
- * - Additional notes
277
- */
278
- notes?: string;
279
- };
280
- export type PayrollRecord = {
281
- /**
282
- * - Employee identifier
283
- */
284
- employeeId: string;
285
- /**
286
- * - Organization identifier
287
- */
288
- organizationId: string;
289
- /**
290
- * - Pay period information
291
- */
292
- period: any;
293
- /**
294
- * - Salary breakdown
295
- */
296
- breakdown: {
297
- baseAmount: number;
298
- allowances: any[];
299
- deductions: any[];
300
- grossSalary: number;
301
- netSalary: number;
302
- };
303
- /**
304
- * - Payroll status ('pending', 'processed', 'paid')
305
- */
306
- status: string;
307
- /**
308
- * - When payroll was processed
309
- */
310
- processedAt: Date | null;
311
- /**
312
- * - When payment was made
313
- */
314
- paidAt: Date | null;
315
- /**
316
- * - Additional metadata
317
- */
318
- metadata: PayrollMetadata;
319
- };
@@ -1,47 +0,0 @@
1
- export const hrmOrchestrator: HRMOrchestrator;
2
- export const hrm: HRMOrchestrator;
3
- export default hrm;
4
- declare class HRMOrchestrator {
5
- _models: {
6
- EmployeeModel: any;
7
- PayrollRecordModel: any;
8
- TransactionModel: any;
9
- AttendanceModel: any;
10
- };
11
- _initialized: boolean;
12
- configure({ EmployeeModel, PayrollRecordModel, TransactionModel, AttendanceModel }: {
13
- EmployeeModel: any;
14
- PayrollRecordModel: any;
15
- TransactionModel: any;
16
- AttendanceModel?: any;
17
- }): void;
18
- _ensureInitialized(): void;
19
- isInitialized(): boolean;
20
- hire(params: any): Promise<any>;
21
- updateEmployment(params: any): Promise<any>;
22
- terminate(params: any): Promise<any>;
23
- reHire(params: any): Promise<any>;
24
- listEmployees(params: any): Promise<any>;
25
- getEmployee(params: any): Promise<any>;
26
- updateSalary(params: any): Promise<any>;
27
- addAllowance(params: any): Promise<any>;
28
- removeAllowance(params: any): Promise<any>;
29
- addDeduction(params: any): Promise<any>;
30
- removeDeduction(params: any): Promise<any>;
31
- updateBankDetails(params: any): Promise<any>;
32
- processSalary(params: any): Promise<{
33
- payrollRecord: any;
34
- transaction: any;
35
- employee: any;
36
- }>;
37
- processBulkPayroll(params: any): Promise<{
38
- successful: any[];
39
- failed: any[];
40
- total: any;
41
- }>;
42
- payrollHistory(params: any): Promise<any>;
43
- payrollSummary(params: any): Promise<any>;
44
- exportPayroll(params: any): Promise<any>;
45
- getEmployeeModel(): any;
46
- getPayrollRecordModel(): any;
47
- }
@@ -1,20 +0,0 @@
1
- export { setLogger } from "./utils/logger.js";
2
- export { employeePlugin } from "./plugins/employee.plugin.js";
3
- export { default as PayrollRecord } from "./models/payroll-record.model.js";
4
- export default hrmDefault;
5
- import { hrm as hrmDefault } from './hrm.orchestrator.js';
6
- export { initializeHRM, isInitialized } from "./init.js";
7
- export { EMPLOYMENT_TYPE, EMPLOYMENT_TYPE_VALUES, EMPLOYEE_STATUS, EMPLOYEE_STATUS_VALUES, DEPARTMENT, DEPARTMENT_VALUES, PAYMENT_FREQUENCY, PAYMENT_FREQUENCY_VALUES, PAYMENT_METHOD, PAYMENT_METHOD_VALUES, ALLOWANCE_TYPE, ALLOWANCE_TYPE_VALUES, DEDUCTION_TYPE, DEDUCTION_TYPE_VALUES, PAYROLL_STATUS, PAYROLL_STATUS_VALUES, TERMINATION_REASON, TERMINATION_REASON_VALUES, HRM_TRANSACTION_CATEGORIES, HRM_CATEGORY_VALUES, isHRMManagedCategory } from "./enums.js";
8
- export { HRM_CONFIG, SALARY_BANDS, TAX_BRACKETS, ORG_ROLES, ORG_ROLE_KEYS, ROLE_MAPPING, calculateTax, getSalaryBand, determineOrgRole } from "./config.js";
9
- export { employmentFields, allowanceSchema, deductionSchema, compensationSchema, workScheduleSchema, bankDetailsSchema, employmentHistorySchema, payrollStatsSchema } from "./schemas/employment.schema.js";
10
- export { hrm, hrmOrchestrator } from "./hrm.orchestrator.js";
11
- export { addDays, addMonths, diffInDays, diffInMonths, startOfMonth, endOfMonth, startOfYear, endOfYear, isWeekday, isWeekend, getPayPeriod, getCurrentPeriod, calculateProbationEnd, formatDateForDB, parseDBDate } from "./utils/date.utils.js";
12
- export { sum, sumBy, sumAllowances, sumDeductions, calculateGross, calculateNet, applyPercentage, calculatePercentage, createAllowanceCalculator, createDeductionCalculator, calculateTotalCompensation, pipe, compose } from "./utils/calculation.utils.js";
13
- export { isActive, isOnLeave, isSuspended, isTerminated, isEmployed, canReceiveSalary, hasCompensation, required, minValue, maxValue, isInRange, isPositive, isValidStatus, isValidEmploymentType, compose as composeValidators } from "./utils/validation.utils.js";
14
- export { QueryBuilder, EmployeeQueryBuilder, PayrollQueryBuilder, employee, payroll, toObjectId } from "./utils/query-builders.js";
15
- export { EmployeeFactory, EmployeeBuilder, createEmployee } from "./factories/employee.factory.js";
16
- export { PayrollFactory, PayrollBuilder, BatchPayrollFactory, createPayroll } from "./factories/payroll.factory.js";
17
- export { CompensationFactory, CompensationBuilder, CompensationPresets, createCompensation } from "./factories/compensation.factory.js";
18
- export { EmployeeService, createEmployeeService } from "./services/employee.service.js";
19
- export { PayrollService, createPayrollService } from "./services/payroll.service.js";
20
- export { CompensationService, createCompensationService } from "./services/compensation.service.js";
@@ -1,30 +0,0 @@
1
- /**
2
- * Initialize HRM/Payroll framework
3
- *
4
- * @param {Object} options - Initialization options
5
- * @param {Model} options.EmployeeModel - Employee model (required)
6
- * @param {Model} options.PayrollRecordModel - Payroll record model (required)
7
- * @param {Model} options.TransactionModel - Transaction model (required)
8
- * @param {Model} options.AttendanceModel - Optional attendance model for integration
9
- * @param {Object} options.logger - Optional custom logger
10
- *
11
- * @example Multi-Tenant (default)
12
- * initializeHRM({
13
- * EmployeeModel,
14
- * PayrollRecordModel,
15
- * TransactionModel
16
- * });
17
- *
18
- * @example Single-Tenant
19
- * // For single-tenant apps, add organizationId with default value in your Employee schema:
20
- * // organizationId: { type: ObjectId, required: true, default: () => FIXED_ORG_ID }
21
- */
22
- export function initializeHRM({ EmployeeModel, PayrollRecordModel, TransactionModel, AttendanceModel, logger: customLogger }: {
23
- EmployeeModel: Model;
24
- PayrollRecordModel: Model;
25
- TransactionModel: Model;
26
- AttendanceModel: Model;
27
- logger: any;
28
- }): void;
29
- export function isInitialized(): boolean;
30
- export default initializeHRM;
@@ -1,3 +0,0 @@
1
- export default PayrollRecord;
2
- declare const PayrollRecord: mongoose.Model<any, {}, {}, {}, any, any, any>;
3
- import mongoose from 'mongoose';
@@ -1,2 +0,0 @@
1
- export function employeePlugin(schema: any, options?: {}): void;
2
- export default employeePlugin;