@@ -7,19 +7,18 @@ export default {
7
7
departmentId : {
8
8
type : "string" ,
9
9
label : "Department" ,
10
- description : "The department to filter by " ,
10
+ description : "The employee department " ,
11
11
async options ( { page } ) {
12
12
const departments = await this . getDepartments ( {
13
13
params : {
14
14
page : page + 1 ,
15
15
} ,
16
- } ) ;
16
+ } ) ; console . log ( departments ) ;
17
17
return departments . map ( ( department ) => ( {
18
- label : department . name ,
19
- value : department . id ,
18
+ label : department . xDepartmentName ,
19
+ value : department . Id ,
20
20
} ) ) ;
21
21
} ,
22
- optional : true ,
23
22
} ,
24
23
jobTitle : {
25
24
type : "string" ,
@@ -32,11 +31,10 @@ export default {
32
31
} ,
33
32
} ) ;
34
33
return jobTitles . map ( ( jobTitle ) => ( {
35
- label : jobTitle . name ,
36
- value : jobTitle . id ,
34
+ label : jobTitle . xPositionTitle ,
35
+ value : jobTitle . Id ,
37
36
} ) ) ;
38
37
} ,
39
- optional : true ,
40
38
} ,
41
39
leaveType : {
42
40
type : "string" ,
@@ -101,6 +99,38 @@ export default {
101
99
} ) ) ;
102
100
} ,
103
101
} ,
102
+ locationId : {
103
+ type : "string" ,
104
+ label : "Location ID" ,
105
+ description : "The ID of a location" ,
106
+ async options ( { page } ) {
107
+ const locations = await this . getLocations ( {
108
+ params : {
109
+ page : page + 1 ,
110
+ } ,
111
+ } ) ;
112
+ return locations . map ( ( location ) => ( {
113
+ label : location . xLocationName ,
114
+ value : location . Id ,
115
+ } ) ) ;
116
+ } ,
117
+ } ,
118
+ employmentStatusId : {
119
+ type : "string" ,
120
+ label : "Employment Status ID" ,
121
+ description : "The ID of an employment status" ,
122
+ async options ( { page } ) {
123
+ const statuses = await this . getEmploymentStatus ( {
124
+ params : {
125
+ page : page + 1 ,
126
+ } ,
127
+ } ) ;
128
+ return statuses . map ( ( status ) => ( {
129
+ label : status . xType ,
130
+ value : status . Id ,
131
+ } ) ) ;
132
+ } ,
133
+ } ,
104
134
hours : {
105
135
type : "integer" ,
106
136
label : "Hours Worked" ,
@@ -136,6 +166,21 @@ export default {
136
166
type : "string" ,
137
167
label : "Start Date" ,
138
168
description : "The employee's start date (YYYY-MM-DD)" ,
169
+ } ,
170
+ employeeNumber : {
171
+ type : "string" ,
172
+ label : "Employee Number" ,
173
+ description : "Unique employee number" ,
174
+ } ,
175
+ recordStatus : {
176
+ type : "string" ,
177
+ label : "Record Status" ,
178
+ description : "The employee status" ,
179
+ options : [
180
+ "Active" ,
181
+ "Inactive" ,
182
+ ] ,
183
+ default : "Active" ,
139
184
optional : true ,
140
185
} ,
141
186
approvalNote : {
@@ -151,7 +196,8 @@ export default {
151
196
} ,
152
197
_authHeaders ( ) {
153
198
return {
154
- "Authorization" : `Bearer ${ this . $auth . api_key } ` ,
199
+ "customer_key" : `${ this . $auth . consumer_key } ` ,
200
+ "customer_secret" : `${ this . $auth . consumer_secret } ` ,
155
201
"Content-Type" : "application/json" ,
156
202
} ;
157
203
} ,
@@ -218,23 +264,21 @@ export default {
218
264
async createEmployee ( args = { } ) {
219
265
return this . _makeRequest ( {
220
266
method : "POST" ,
221
- path : "/employees " ,
267
+ path : "/xEmployee " ,
222
268
...args ,
223
269
} ) ;
224
270
} ,
225
271
async getDepartments ( args = { } ) {
226
- const response = await this . _makeRequest ( {
227
- path : "/departments " ,
272
+ return this . _makeRequest ( {
273
+ path : "/xDepartment " ,
228
274
...args ,
229
275
} ) ;
230
- return response . departments || [ ] ;
231
276
} ,
232
277
async getJobTitles ( args = { } ) {
233
- const response = await this . _makeRequest ( {
234
- path : "/job-titles " ,
278
+ return this . _makeRequest ( {
279
+ path : "/xPosition " ,
235
280
...args ,
236
281
} ) ;
237
- return response . job_titles || [ ] ;
238
282
} ,
239
283
async getLeaveRequests ( args = { } ) {
240
284
const response = await this . _makeRequest ( {
@@ -250,6 +294,18 @@ export default {
250
294
} ) ;
251
295
return response . leave_types || [ ] ;
252
296
} ,
297
+ async getLocations ( args = { } ) {
298
+ return this . _makeRequest ( {
299
+ path : "/xLocation" ,
300
+ ...args ,
301
+ } ) ;
302
+ } ,
303
+ async getEmploymentStatus ( args = { } ) {
304
+ return this . _makeRequest ( {
305
+ path : "/xEmploymentStatus" ,
306
+ ...args ,
307
+ } ) ;
308
+ } ,
253
309
async approveLeaveRequest ( requestId , args = { } ) {
254
310
return this . _makeRequest ( {
255
311
method : "PUT" ,
0 commit comments