-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathemployments.ts
More file actions
246 lines (204 loc) · 6.17 KB
/
employments.ts
File metadata and controls
246 lines (204 loc) · 6.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import * as HRISAPI from './hris';
import { PagePromise, ResponsesPage } from '../../core/pagination';
import { RequestOptions } from '../../internal/request-options';
export class Employments extends APIResource {
/**
* Read individual employment and income data
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const employmentDataResponse of client.hris.employments.retrieveMany(
* { requests: [{ individual_id: 'individual_id' }] },
* )) {
* // ...
* }
* ```
*/
retrieveMany(
params: EmploymentRetrieveManyParams,
options?: RequestOptions,
): PagePromise<EmploymentDataResponsesPage, EmploymentDataResponse> {
const { entity_ids, ...body } = params;
return this._client.getAPIList('/employer/employment', ResponsesPage<EmploymentDataResponse>, {
query: { entity_ids },
body,
method: 'post',
...options,
__security: { bearerAuth: true },
});
}
}
export type EmploymentDataResponsesPage = ResponsesPage<EmploymentDataResponse>;
export type EmploymentData = EmploymentData.UnionMember0 | EmploymentData.BatchError;
export namespace EmploymentData {
export interface UnionMember0 {
/**
* A stable Finch `id` (UUID v4) for an individual in the company.
*/
id: string;
/**
* Worker's compensation classification code for this employee
*/
class_code: string | null;
/**
* The department object.
*/
department: UnionMember0.Department | null;
/**
* The employment object.
*/
employment: UnionMember0.Employment | null;
/**
* The detailed employment status of the individual.
*/
employment_status:
| 'active'
| 'deceased'
| 'leave'
| 'onboarding'
| 'prehire'
| 'retired'
| 'terminated'
| null;
end_date: string | null;
/**
* The legal first name of the individual.
*/
first_name: string | null;
/**
* The FLSA status of the individual. Available options: `exempt`, `non_exempt`,
* `unknown`.
*/
flsa_status: 'exempt' | 'non_exempt' | 'unknown' | null;
/**
* `true` if the individual an an active employee or contractor at the company.
*/
is_active: boolean | null;
/**
* The legal last name of the individual.
*/
last_name: string | null;
latest_rehire_date: string | null;
location: HRISAPI.Location | null;
/**
* The manager object representing the manager of the individual within the org.
*/
manager: UnionMember0.Manager | null;
/**
* The legal middle name of the individual.
*/
middle_name: string | null;
start_date: string | null;
/**
* The current title of the individual.
*/
title: string | null;
/**
* Custom fields for the individual. These are fields which are defined by the
* employer in the system. Custom fields are not currently supported for assisted
* connections.
*/
custom_fields?: Array<UnionMember0.CustomField> | null;
/**
* The employee's income as reported by the provider. This may not always be
* annualized income, but may be in units of bi-weekly, semi-monthly, daily, etc,
* depending on what information the provider returns.
*/
income?: HRISAPI.Income | null;
/**
* The array of income history.
*/
income_history?: Array<HRISAPI.Income | null> | null;
/**
* The source system's unique employment identifier for this individual
*/
source_id?: string | null;
/**
* @deprecated This field is deprecated in favour of `source_id`
*/
work_id?: string | null;
}
export namespace UnionMember0 {
/**
* The department object.
*/
export interface Department {
/**
* The name of the department associated with the individual.
*/
name: string | null;
}
/**
* The employment object.
*/
export interface Employment {
/**
* The secondary employment type of the individual. Options: `full_time`,
* `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`.
*/
subtype: 'full_time' | 'intern' | 'part_time' | 'temp' | 'seasonal' | 'individual_contractor' | null;
/**
* The main employment type of the individual.
*/
type: 'employee' | 'contractor' | null;
}
/**
* The manager object representing the manager of the individual within the org.
*/
export interface Manager {
/**
* A stable Finch `id` (UUID v4) for an individual in the company.
*/
id: string;
}
export interface CustomField {
name?: string | null;
value?: string | null | Array<unknown> | null | unknown | number | null | boolean | null;
}
}
export interface BatchError {
code: number;
message: string;
name: string;
finch_code?: string;
}
}
export interface EmploymentDataResponse {
body: EmploymentData;
code: number;
/**
* A stable Finch `id` (UUID v4) for an individual in the company.
*/
individual_id: string;
}
export interface EmploymentRetrieveManyParams {
/**
* Body param: The array of batch requests.
*/
requests: Array<EmploymentRetrieveManyParams.Request>;
/**
* Query param: The entity IDs to specify which entities' data to access.
*/
entity_ids?: Array<string>;
}
export namespace EmploymentRetrieveManyParams {
export interface Request {
/**
* A stable Finch `id` (UUID v4) for an individual in the company. There is no
* limit to the number of `individual_id` to send per request. It is preferantial
* to send all ids in a single request for Finch to optimize provider rate-limits.
*/
individual_id: string;
}
}
export declare namespace Employments {
export {
type EmploymentData as EmploymentData,
type EmploymentDataResponse as EmploymentDataResponse,
type EmploymentDataResponsesPage as EmploymentDataResponsesPage,
type EmploymentRetrieveManyParams as EmploymentRetrieveManyParams,
};
}