Scheduling Employee Preferences
Scheduling employee preferences affect schedule generation for each employee.
Preferences include:
- Preferred Availability
- Preferred Job
- Preferred Hours Per Week
- Preferred Day Off
- Most Hours Per Week
- Earliest Shift
- Longest Shift
You can assign, update, delete, and retrieve details about Scheduling employee preferences using operations against the /v1/commons/persons/scheduling_employee_preferences
resource.
Prerequisites
A person's person ID is the same as the personKey
and employee ID, and is not the same as the person number.
The person in this example has a person ID of 100 and a person number of 20190.
Example
In this example, we assign, verify, update, and delete a person's Scheduling employee preferences.
Create the assignment
The create request:
- uses
personIdentity
to identify the person using their person number - uses the
zone
object to define the Scheduling employee preferencezone
andzoneSet
to assign
Example request
Call PUT /v1/commons/persons/scheduling_employee_preferences
with the following request payload.
{
"personIdentity":{
"personNumber":"20190"
},
"zone": {
"zoneSet": {
"qualifier": "WMNB NURSE 6"
},
"zone": {
"qualifier": "1800-2200"
}
}
}
Example response
A success response returns HTTP status code 200 and a response body similar to the following example.
{
"personIdentity": {
"personNumber": "20190"
},
"zone": {
"zoneSet": {
"qualifier": "WMNB NURSE 6"
},
"zone": {
"qualifier": "1800-2200"
}
}
}
Verify the assignment
To verify, you can call GET /v1/commons/persons/scheduling_employee_preferences?person_number={personNumber}
or GET /v1/commons/persons/scheduling_employee_preferences/{personId}
.
Calling GET /v1/commons/persons/scheduling_employee_preferences?person_number=20190
or GET /v1/commons/persons/scheduling_employee_preferences/100
returns:
{
"personIdentity": {
"personKey": 100,
"personNumber": "20190"
},
"zone": {
"zoneSet": {
"id": 3,
"qualifier": "WMNB NURSE 6"
},
"zone": {
"id": 9,
"qualifier": "1800-2200"
}
}
}
Update the assignment
You can perform a full replacement update by calling PUT /v1/commons/persons/scheduling_employee_preferences
.
Example request
Call PUT /v1/commons/persons/scheduling_employee_preferences
with the following request payload.
{
"personIdentity":{
"personNumber":"20190"
},
"zone": {
"zoneSet": {
"qualifier": "WMNB NURSE 6"
},
"zone": {
"qualifier": "1400-1800"
}
}
}
Example response
A success response returns HTTP status code 200 and a response body similar to the following example.
{
"personIdentity": {
"personNumber": "20190"
},
"zone": {
"zoneSet": {
"qualifier": "WMNB NURSE 6"
},
"zone": {
"qualifier": "1400-1800"
}
}
}
Delete an assignment
To delete a person's Scheduling employee preferences, call PUT /v1/commons/persons/scheduling_employee_preferences
and remove the unwanted Scheduling employee preferences from the request.
Example request
{
"personIdentity":{
"personNumber":"20190"
},
"zone": {
"zoneSet": {},
"zone": {}
}
}
Example response
{
"personIdentity": {
"personNumber": "20190"
},
"zone": {
"zoneSet": {}
}
}
Updated over 1 year ago