@markwharton/eh-payroll 3.0.0 → 3.1.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.
- package/dist/client.js +4 -4
- package/dist/employee-types.generated.d.ts +61 -58
- package/dist/employee-types.generated.js +0 -8
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +8 -4
- package/dist/types.js +1 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -321,8 +321,8 @@ export class EHClient {
|
|
|
321
321
|
params.set('$top', String(DEFAULT_PAGE_SIZE));
|
|
322
322
|
return this.fetchPaginated((skip) => {
|
|
323
323
|
params.set('$skip', String(skip));
|
|
324
|
-
return this.businessUrl(ENTITIES.
|
|
325
|
-
}, ENTITIES.
|
|
324
|
+
return this.businessUrl(ENTITIES.EHEmployee.path, params);
|
|
325
|
+
}, ENTITIES.EHEmployee.fields);
|
|
326
326
|
}, this.restrictedPersistOpt);
|
|
327
327
|
}
|
|
328
328
|
/**
|
|
@@ -330,9 +330,9 @@ export class EHClient {
|
|
|
330
330
|
*/
|
|
331
331
|
async getEmployee(employeeId) {
|
|
332
332
|
return this.cached(`employee:${employeeId}`, this.cacheTtl.employeesTtl, async () => {
|
|
333
|
-
const url = this.businessUrl(`${ENTITIES.
|
|
333
|
+
const url = this.businessUrl(`${ENTITIES.EHEmployee.path}/${employeeId}`);
|
|
334
334
|
return this.fetchAndParse(url, async (r) => {
|
|
335
|
-
return pickFields(await r.json(), ENTITIES.
|
|
335
|
+
return pickFields(await r.json(), ENTITIES.EHEmployee.fields);
|
|
336
336
|
});
|
|
337
337
|
}, this.restrictedPersistOpt);
|
|
338
338
|
}
|
|
@@ -4,26 +4,48 @@
|
|
|
4
4
|
* Generated from KeyPay AU Swagger spec. DO NOT EDIT MANUALLY.
|
|
5
5
|
* Run: npx tsx scripts/generate-types.ts
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Total fields: 139
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
export
|
|
9
|
+
export type EHCloselyHeldReporting = 'PerQuarter' | 'PerPayRun';
|
|
10
|
+
export type EHEmployeeStatus = 'Active' | 'Terminated' | 'Incomplete';
|
|
11
|
+
export type EHLeaveAccrualStartDateType = 'EmployeeStartDate' | 'SpecifiedDate' | 'CalendarYear' | 'CategorySpecificDate';
|
|
12
|
+
export type EHMedicareLevySurchargeWithholdingTier = 'Tier1' | 'Tier2' | 'Tier3';
|
|
13
|
+
export type EHSingleTouchPayrollCategory = 'CloselyHeld' | 'ForeignEmployment' | 'InboundAssignee' | 'LabourHire' | 'OtherSpecifiedPayments' | 'SalaryAndWages' | 'WorkingHolidayMaker' | 'SeasonalWorker';
|
|
14
|
+
export type EHTaxCategory = 'Actor_WithTaxFreeThreshold' | 'Actor_NoTaxFreeThreshold' | 'Actor_LimitedPerformancePerWeek' | 'Actor_Promotional' | 'HorticulturalistShearer_WithTaxFreeThreshold' | 'HorticulturalistShearer_ForeignResident' | 'SeniorPensioner_Single' | 'SeniorPensioner_Married' | 'SeniorPensioner_SeparatedCoupleIllness' | 'ATODefined_DeathBeneficiary' | 'ATODefined_DownwardVariation' | 'ATODefined_NonEmployee' | 'DailyCasual';
|
|
15
|
+
/** AU employee from unstructured endpoint (139 fields) */
|
|
16
|
+
export interface EHEmployee {
|
|
11
17
|
anniversaryDate: string | null;
|
|
18
|
+
australianResident: boolean;
|
|
19
|
+
automaticallyApplyPublicHolidayNotWorkedEarningsLines: boolean;
|
|
12
20
|
automaticallyPayEmployee: string | null;
|
|
21
|
+
awardId: number | null;
|
|
13
22
|
bankAccount1_AccountName: string | null;
|
|
14
23
|
bankAccount1_AccountNumber: string | null;
|
|
15
24
|
bankAccount1_AllocatedPercentage: number | null;
|
|
25
|
+
bankAccount1_BSB: string | null;
|
|
16
26
|
bankAccount1_FixedAmount: number | null;
|
|
17
27
|
bankAccount2_AccountName: string | null;
|
|
18
28
|
bankAccount2_AccountNumber: string | null;
|
|
19
29
|
bankAccount2_AllocatedPercentage: number | null;
|
|
30
|
+
bankAccount2_BSB: string | null;
|
|
20
31
|
bankAccount2_FixedAmount: number | null;
|
|
21
32
|
bankAccount3_AccountName: string | null;
|
|
22
33
|
bankAccount3_AccountNumber: string | null;
|
|
23
34
|
bankAccount3_AllocatedPercentage: number | null;
|
|
35
|
+
bankAccount3_BSB: string | null;
|
|
24
36
|
bankAccount3_FixedAmount: number | null;
|
|
37
|
+
businessAwardPackage: string | null;
|
|
38
|
+
claimMedicareLevyReduction: boolean;
|
|
39
|
+
claimTaxFreeThreshold: boolean;
|
|
40
|
+
closelyHeldEmployee: boolean;
|
|
41
|
+
closelyHeldReporting: EHCloselyHeldReporting | null;
|
|
42
|
+
contractorABN: string | null;
|
|
25
43
|
dateCreated: string | null;
|
|
26
44
|
dateOfBirth: string | null;
|
|
45
|
+
dateTaxFileDeclarationReported: string | null;
|
|
46
|
+
dateTaxFileDeclarationSigned: string | null;
|
|
47
|
+
disableAutoProgression: boolean;
|
|
48
|
+
dvlPaySlipDescription: string | null;
|
|
27
49
|
emailAddress: string | null;
|
|
28
50
|
emergencyContact1_Address: string | null;
|
|
29
51
|
emergencyContact1_AlternateContactNumber: string | null;
|
|
@@ -35,95 +57,71 @@ export interface EHEmployeeCommon {
|
|
|
35
57
|
emergencyContact2_ContactNumber: string | null;
|
|
36
58
|
emergencyContact2_Name: string | null;
|
|
37
59
|
emergencyContact2_Relationship: string | null;
|
|
60
|
+
employingEntityABN: string | null;
|
|
61
|
+
employingEntityId: string | null;
|
|
62
|
+
employmentAgreement: string | null;
|
|
63
|
+
employmentAgreementId: number | null;
|
|
64
|
+
employmentType: string | null;
|
|
38
65
|
endDate: string | null;
|
|
39
66
|
externalId: string | null;
|
|
40
67
|
firstName: string | null;
|
|
41
68
|
gender: string | null;
|
|
69
|
+
hasApprovedWorkingHolidayVisa: boolean;
|
|
70
|
+
hasWithholdingVariation: boolean;
|
|
42
71
|
homePhone: string | null;
|
|
72
|
+
hoursPerDay: number | null;
|
|
43
73
|
hoursPerWeek: number | null;
|
|
44
74
|
id: number | null;
|
|
75
|
+
includeInPortableLongServiceLeaveReport: boolean;
|
|
45
76
|
isEnabledForTimesheets: string | null;
|
|
77
|
+
isExemptFromFloodLevy: boolean;
|
|
78
|
+
isExemptFromPayrollTax: boolean;
|
|
79
|
+
isSeasonalWorker: boolean;
|
|
46
80
|
jobTitle: string | null;
|
|
47
|
-
leaveAccrualStartDateType:
|
|
81
|
+
leaveAccrualStartDateType: EHLeaveAccrualStartDateType | null;
|
|
48
82
|
leaveTemplate: string | null;
|
|
49
83
|
leaveYearStart: string | null;
|
|
50
84
|
locations: string | null;
|
|
85
|
+
maximumQuarterlySuperContributionsBase: number | null;
|
|
86
|
+
medicareLevyExemption: string | null;
|
|
87
|
+
medicareLevyReductionDependentCount: number | null;
|
|
88
|
+
medicareLevyReductionSpouse: boolean;
|
|
89
|
+
medicareLevySurchargeWithholdingTier: EHMedicareLevySurchargeWithholdingTier | null;
|
|
51
90
|
middleName: string | null;
|
|
52
91
|
mobilePhone: string | null;
|
|
92
|
+
otherTaxOffset: boolean;
|
|
53
93
|
overrideTemplateRate: string | null;
|
|
54
94
|
payConditionRuleSet: string | null;
|
|
55
95
|
payRateTemplate: string | null;
|
|
56
96
|
paySchedule: string | null;
|
|
57
97
|
paySlipNotificationType: string | null;
|
|
98
|
+
portableLongServiceLeaveId: string | null;
|
|
99
|
+
postalAddressIsOverseas: boolean;
|
|
58
100
|
postalAddressLine2: string | null;
|
|
59
101
|
postalCountry: string | null;
|
|
60
102
|
postalPostCode: string | null;
|
|
103
|
+
postalState: string | null;
|
|
61
104
|
postalStreetAddress: string | null;
|
|
105
|
+
postalSuburb: string | null;
|
|
62
106
|
preferredName: string | null;
|
|
107
|
+
previousSurname: string | null;
|
|
63
108
|
primaryLocation: string | null;
|
|
64
109
|
primaryPayCategory: string | null;
|
|
65
110
|
rate: number | null;
|
|
66
111
|
rateUnit: string | null;
|
|
67
112
|
reportingDimensionValues: string | null;
|
|
113
|
+
residentialAddressIsOverseas: boolean;
|
|
68
114
|
residentialAddressLine2: string | null;
|
|
69
115
|
residentialCountry: string | null;
|
|
70
116
|
residentialPostCode: string | null;
|
|
71
|
-
residentialStreetAddress: string | null;
|
|
72
|
-
rosteringNotificationChoices: string | null;
|
|
73
|
-
startDate: string | null;
|
|
74
|
-
status: 'Active' | 'Terminated' | 'Incomplete' | null;
|
|
75
|
-
surname: string | null;
|
|
76
|
-
tags: string | null;
|
|
77
|
-
title: string | null;
|
|
78
|
-
workPhone: string | null;
|
|
79
|
-
workTypes: string | null;
|
|
80
|
-
}
|
|
81
|
-
/** AU region employee (70 region-specific fields) */
|
|
82
|
-
export interface EHEmployee extends EHEmployeeCommon {
|
|
83
|
-
australianResident: boolean;
|
|
84
|
-
automaticallyApplyPublicHolidayNotWorkedEarningsLines: boolean;
|
|
85
|
-
awardId: number | null;
|
|
86
|
-
bankAccount1_BSB: string | null;
|
|
87
|
-
bankAccount2_BSB: string | null;
|
|
88
|
-
bankAccount3_BSB: string | null;
|
|
89
|
-
businessAwardPackage: string | null;
|
|
90
|
-
claimMedicareLevyReduction: boolean;
|
|
91
|
-
claimTaxFreeThreshold: boolean;
|
|
92
|
-
closelyHeldEmployee: boolean;
|
|
93
|
-
closelyHeldReporting: 'PerQuarter' | 'PerPayRun' | null;
|
|
94
|
-
contractorABN: string | null;
|
|
95
|
-
dateTaxFileDeclarationReported: string | null;
|
|
96
|
-
dateTaxFileDeclarationSigned: string | null;
|
|
97
|
-
disableAutoProgression: boolean;
|
|
98
|
-
dvlPaySlipDescription: string | null;
|
|
99
|
-
employingEntityABN: string | null;
|
|
100
|
-
employingEntityId: string | null;
|
|
101
|
-
employmentAgreement: string | null;
|
|
102
|
-
employmentAgreementId: number | null;
|
|
103
|
-
employmentType: string | null;
|
|
104
|
-
hasApprovedWorkingHolidayVisa: boolean;
|
|
105
|
-
hasWithholdingVariation: boolean;
|
|
106
|
-
hoursPerDay: number | null;
|
|
107
|
-
includeInPortableLongServiceLeaveReport: boolean;
|
|
108
|
-
isExemptFromFloodLevy: boolean;
|
|
109
|
-
isExemptFromPayrollTax: boolean;
|
|
110
|
-
isSeasonalWorker: boolean;
|
|
111
|
-
maximumQuarterlySuperContributionsBase: number | null;
|
|
112
|
-
medicareLevyExemption: string | null;
|
|
113
|
-
medicareLevyReductionDependentCount: number | null;
|
|
114
|
-
medicareLevyReductionSpouse: boolean;
|
|
115
|
-
medicareLevySurchargeWithholdingTier: 'Tier1' | 'Tier2' | 'Tier3' | null;
|
|
116
|
-
otherTaxOffset: boolean;
|
|
117
|
-
portableLongServiceLeaveId: string | null;
|
|
118
|
-
postalAddressIsOverseas: boolean;
|
|
119
|
-
postalState: string | null;
|
|
120
|
-
postalSuburb: string | null;
|
|
121
|
-
previousSurname: string | null;
|
|
122
|
-
residentialAddressIsOverseas: boolean;
|
|
123
117
|
residentialState: string | null;
|
|
118
|
+
residentialStreetAddress: string | null;
|
|
124
119
|
residentialSuburb: string | null;
|
|
120
|
+
rosteringNotificationChoices: string | null;
|
|
125
121
|
seniorsTaxOffset: boolean;
|
|
126
|
-
singleTouchPayroll:
|
|
122
|
+
singleTouchPayroll: EHSingleTouchPayrollCategory | null;
|
|
123
|
+
startDate: string | null;
|
|
124
|
+
status: EHEmployeeStatus | null;
|
|
127
125
|
stslDebt: boolean;
|
|
128
126
|
superFund1_AllocatedPercentage: number | null;
|
|
129
127
|
superFund1_EmployerNominatedFund: boolean;
|
|
@@ -144,10 +142,15 @@ export interface EHEmployee extends EHEmployeeCommon {
|
|
|
144
142
|
superFund3_MemberNumber: string | null;
|
|
145
143
|
superFund3_ProductCode: string | null;
|
|
146
144
|
superThresholdAmount: number | null;
|
|
147
|
-
|
|
145
|
+
surname: string | null;
|
|
146
|
+
tags: string | null;
|
|
147
|
+
taxCategory: EHTaxCategory | null;
|
|
148
148
|
taxFileNumber: string | null;
|
|
149
149
|
taxVariation: number | null;
|
|
150
150
|
terminationReason: string | null;
|
|
151
|
+
title: string | null;
|
|
151
152
|
workingHolidayVisaCountry: string | null;
|
|
152
153
|
workingHolidayVisaStartDate: string | null;
|
|
154
|
+
workPhone: string | null;
|
|
155
|
+
workTypes: string | null;
|
|
153
156
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export { EHClient } from './client.js';
|
|
23
|
-
export type { EHConfig, EHCacheConfig, EHRetryConfig, EHLeaveRequest, EHLeaveRequestOptions, EHEmployeeLeaveRequestOptions, EHLeaveRequestStatus, EHEmployee, EHEmployeeOptions, EHStandardHours, EHLocation, EHEmployeeGroup, EHRosterShift, EHRosterShiftOptions, EHAttendanceStatus, EHKiosk, EHKioskEmployee, EHKioskStaffOptions, EHEmployeeImage, } from './types.js';
|
|
23
|
+
export type { EHConfig, EHCacheConfig, EHRetryConfig, EHLeaveRequest, EHLeaveRequestOptions, EHLeaveRequestGroupBy, EHEmployeeLeaveRequestOptions, EHLeaveRequestStatus, EHEmployee, EHEmployeeStatus, EHLeaveAccrualStartDateType, EHCloselyHeldReporting, EHMedicareLevySurchargeWithholdingTier, EHSingleTouchPayrollCategory, EHTaxCategory, EHEmployeeOptions, EHStandardHours, EHLocation, EHEmployeeGroup, EHRosterShift, EHRosterShiftOptions, EHShiftStatus, EHAttendanceStatus, EHKiosk, EHKioskEmployee, EHKioskStaffOptions, EHEmployeeImage, } from './types.js';
|
|
24
24
|
export { EMPLOYEE_FIELDS, LEAVE_REQUEST_FIELDS, LOCATION_FIELDS, EMPLOYEE_GROUP_FIELDS, ROSTER_SHIFT_FIELDS, KIOSK_FIELDS, KIOSK_EMPLOYEE_FIELDS, ENTITIES, } from './types.js';
|
|
25
25
|
export type { AccessTier } from './types.js';
|
|
26
26
|
export { METHOD_TIERS } from './types.js';
|
package/dist/types.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export interface EHConfig extends ClientConfig {
|
|
|
56
56
|
*
|
|
57
57
|
* @see employee-types.generated.ts
|
|
58
58
|
*/
|
|
59
|
-
export type { EHEmployee } from './employee-types.generated.js';
|
|
59
|
+
export type { EHEmployee, EHEmployeeStatus, EHLeaveAccrualStartDateType, EHCloselyHeldReporting, EHMedicareLevySurchargeWithholdingTier, EHSingleTouchPayrollCategory, EHTaxCategory, } from './employee-types.generated.js';
|
|
60
60
|
/**
|
|
61
61
|
* Standard hours for an employee
|
|
62
62
|
*
|
|
@@ -217,6 +217,8 @@ export interface EHEmployeeImage {
|
|
|
217
217
|
}
|
|
218
218
|
/** Leave request status values */
|
|
219
219
|
export type EHLeaveRequestStatus = 'Approved' | 'Pending' | 'Rejected' | 'Cancelled';
|
|
220
|
+
/** Leave request grouping options */
|
|
221
|
+
export type EHLeaveRequestGroupBy = 'Employee' | 'LeaveType';
|
|
220
222
|
/**
|
|
221
223
|
* Options for getLeaveRequests
|
|
222
224
|
*
|
|
@@ -236,7 +238,7 @@ export interface EHLeaveRequestOptions {
|
|
|
236
238
|
/** Filter by location ID (→ API LocationId) */
|
|
237
239
|
locationId?: number;
|
|
238
240
|
/** Group results by 'Employee' or 'LeaveType' (→ API GroupBy) */
|
|
239
|
-
groupBy?:
|
|
241
|
+
groupBy?: EHLeaveRequestGroupBy;
|
|
240
242
|
/** Restrict results to leave overlapping the date range (→ API RestrictOverlappingLeave) */
|
|
241
243
|
restrictOverlappingLeave?: boolean;
|
|
242
244
|
}
|
|
@@ -262,6 +264,8 @@ export interface EHEmployeeOptions {
|
|
|
262
264
|
/** Filter by location ID */
|
|
263
265
|
locationId?: number;
|
|
264
266
|
}
|
|
267
|
+
/** Roster shift status filter values */
|
|
268
|
+
export type EHShiftStatus = 'All' | 'Published' | 'Unpublished' | 'Accepted';
|
|
265
269
|
/**
|
|
266
270
|
* Options for getRosterShifts
|
|
267
271
|
*/
|
|
@@ -275,9 +279,9 @@ export interface EHRosterShiftOptions {
|
|
|
275
279
|
/** Include shifts with all roles (default: only unassigned roles) */
|
|
276
280
|
selectAllRoles?: boolean;
|
|
277
281
|
/** Filter by single shift status */
|
|
278
|
-
shiftStatus?:
|
|
282
|
+
shiftStatus?: EHShiftStatus;
|
|
279
283
|
/** Filter by multiple shift statuses */
|
|
280
|
-
shiftStatuses?:
|
|
284
|
+
shiftStatuses?: EHShiftStatus[];
|
|
281
285
|
/** Filter by specific locations (multiple) */
|
|
282
286
|
selectedLocations?: string[];
|
|
283
287
|
/** Filter by specific employees (multiple) */
|
package/dist/types.js
CHANGED
|
@@ -111,7 +111,7 @@ export const EMPLOYEE_FIELDS = {
|
|
|
111
111
|
};
|
|
112
112
|
/** Entity registry — maps interface names to field specs and API path segments. */
|
|
113
113
|
export const ENTITIES = {
|
|
114
|
-
|
|
114
|
+
EHEmployee: { fields: EMPLOYEE_FIELDS, path: 'employee/unstructured', apiRef: 'employee/au-employee--get-employees', apiRefById: 'employee/au-employee--get-employee-by-id' },
|
|
115
115
|
EHLeaveRequest: { fields: LEAVE_REQUEST_FIELDS, path: 'leaverequest', apiRef: 'leave-requests/au-business-hours-leave-request--list-leave-requests' },
|
|
116
116
|
EHEmployeeLeaveRequest: { fields: LEAVE_REQUEST_FIELDS, path: 'employee/{employeeId}/leaverequest', apiRef: 'leave-requests/au-hours-leave-request--get-leave-requests' },
|
|
117
117
|
EHLocation: { fields: LOCATION_FIELDS, path: 'location', apiRef: 'location/au-location--get-locations' },
|