Skip to main content
Employees form the foundation for all schedules produced by the solver. The primary objective for all produced schedules is to assign employees to shifts in such a way that they can optimally cover all demand for labour.

Employee schema

employee
object

Attributes

Employee attributes provide a flexible way to specify custom characteristics for each employee. These attributes can be used to determine eligibility for shifts, demands, or tasks. In addition, some constraints can be configured to apply to all employees that meet certain attribute requirements. Some good examples of characteristics where it might make sense to use attributes are departments, competences, or personnel-groups. Each attribute must have its own unique category indicating what kind of attribute it is. An employee can have multiple values for the same attribute. Here’s an example of how to specify attributes for an employee:
The following example shows an employee that is part of the departments finance and hr, and has the competences manager and accountant. Finally, they are part of the personnel group group-1.
{
  "id": "employee-1",
  "attributes": [
    {
      "category": "department",
      "values": ["finance", "hr"]
    },
    {
      "category": "competence",
      "values": ["manager", "accountant"]
    },
    {
      "category": "personnel-group",
      "values": ["group-1"]
    }
  ]
}

Preassigned shifts

It is possible to start the solver from a partially filled schedule where employees already have some shifts assigned to them. These are specified in preassignedShifts. If these pre-assignments are set to isLocked, the solver will never change them. The solver therefore considers unlocked preassigned shifts as suggestions.
The following example shows an employee that is preassigned to work shift-1 shifts on each of the first four days of the schedule. These assignments are set as isLocked and will not be changed by the solver.
{
  "id": "employee-1",
  "preassignedShifts": [
    {
      "shiftId": "shift-1",
      "isLocked": true,
      "days": {
        "dayIndices": [0, 1, 2, 3]
      }
    }
  ]
}

Read-only employees

You can set an employee to isReadOnly to indicate that the solver should only use their preassigned shifts and not assign them to any new shifts. This is useful when you want to preserve certain employee assignments while allowing the solver to optimize the rest of the schedule. When an employee is marked as isReadOnly, the solver will:
  • Use all their preassigned shifts (regardless of whether they are locked or unlocked)
  • Not assign the employee to any additional shifts beyond their preassigned ones
The following example shows an employee that is set to read-only. The solver will only use their preassigned shifts and will not assign them to any new shifts.
{
  "id": "employee-1",
  "isReadOnly": true,
  "preassignedShifts": [
    {
      "shiftId": "shift-1",
      "days": {
        "dayIndices": [0, 1, 2, 3]
      }
    }
  ]
}