Skip to main content

Weekend demand coverage check

Demand-weekend-covered-by-employees

The demand-weekend-covered-by-employees check exists to help awareness on whether weekend demand can be met according to weekend distribution constraints.

For a scenario where Weekend Demand can't be covered, but it's not due to the Weekend Distribution constraint as there is none defined, in such a case we use the MissingEmployees field to mark missing employees. For this constraint to work, the weekend definition must be set in the request payload.

Weekend definition
startWeekDay
required
integer [ 1 .. 7 ]

Index of day on which weekend starts. Can be value [1-7] where 1 = Monday and 7 = Sunday

startTime
string <time> (timeStamp)

TIME ISO 8601 format hh:mm. Equivalent to the 24h format of a single day. Use 00:00 to represent midnight.

endWeekDay
required
integer [ 1 .. 7 ]

Index of day on which weekend ends. Can be value [1-7] where 1 = Monday and 7 = Sunday.

endTime
string <time> (timeStamp)

TIME ISO 8601 format hh:mm. Equivalent to the 24h format of a single day. Use 00:00 to represent midnight.

{
  • "startWeekDay": 1,
  • "startTime": "14:15:22Z",
  • "endWeekDay": 1,
  • "endTime": "14:15:22Z"
}

If the check finds that a weekend demand cannot be met according to the weekend distribution constraints, this is returned as a warning in the feasibility response.

Warning Response Schema
title
required
string
Enum: "Employee-availability-check" "Demand-weekend-covered-by-employees-check" "Employee-minutes-weekly-check" "Employee-minutes-entire-roster-check" "Demand-covered-by-shift-templates-check" "Shift-is-covered-by-demand-check" "Employee-assigned-to-shift-covers-demand-check" "Shift-Templates-are-demand-relevant-check" "Shift-utilization-minimum-occurrence-check" "Locked-shift-task-requirements-check"
category
required
string

This category is always set to WARNING

description
required
string
required
Array of objects (violation)
{
  • "title": "Employee-availability-check",
  • "category": "string",
  • "description": "string",
  • "violations": [
    ]
}

The following fields are used in the "violation" object:

  • weekendNumber: The identifier for the weekend.
  • requiredEmployees: The number of employees needed.
  • numberOfEmployees: The actual number of employees available.
  • missingEmployeesDueToWeekendDistribution: Indicates the shortfall due to weekend distribution constraints (This may change in the future).

The following payload illustrates how the response looks for a payload with weekend distributions, resulting in a warning.

Example

In this example, we illustrate a payload that will cause a warning in the feasibility check. The payload contains a weekend distribution constraint for all employees, which will cause a warning for the weekends that cannot be met due to this constraint.

We illustrate this by example using a payload that requires 3 employees in the timespan of 10:00-14:00 and 2 employees 15:00-16:00. For this to work, we have to set the weekend (saturday and sunday in this case), for which we provide no start time and end time, which then defaults to 00:00 of saturday till 23:59 on sunday, as weekend.

The payload also includes 5 available employees, and a weekend constraint only allowing 1 weekend per employee. The fairness and weight is also set as part of the payload, but this is not taken into consideration for this check: It is only relevant during solving.

The reason why a warning is returned is that for the first weekend, we have 3 employees available, but for the second weekend, we only have 2 employees available, which is not enough to cover the demand.

Once the "third" employee has worked the first weekend, there is no additional employee for the second weekend, which results in a warning.

Notice that due to the stochastic nature of this check, the result may vary between runs (either weekend 1 or weekend 2 may be flagged as a warning).

Payload example
{
"jobInfo": {
"id": "xxx",
"organisationId": "xxx",
"scheduleType": "RECURRING",
"demandType": "TIME_DEMAND",
"planningHorizon": {
"startDate": "2022-01-01",
"nrOfWeeks": 2,
}
},
"shifts": [
{
"id": "Shift1",
"shiftTypes": [
"DAY_W"
],
"intervals": [
{
"startTime": "10:00",
"endTime": "16:00",
"dayIndicator": 0,
"workTypeId": "1",
"breakMinutes": 60
}
]
}
],
"employees": [
{
"id": "1",
"workTime": {
"maxWeekHours": 40
}
},
{
"id": "2",
"workTime": {
"maxWeekHours": 40
}
},
{
"id": "3",
"workTime": {
"maxWeekHours": 40
}
},
{
"id": "4",
"workTime": {
"maxWeekHours": 40
}
},
{
"id": "5",
"workTime": {
"maxWeekHours": 40
}
}
],
"timeSlots": [
{
"startTime": "10:00",
"endTime": "14:00",
"workTypeId": "1",
},
{
"startTime": "15:00",
"endTime": "16:00",
"workTypeId": "1",
}
],
"demands": [
{
"days": {
"dayIndexes": [
5,
6,
12,
13
]
},
"timeDemands": [
{
"timeSlotId": "10_14",
"ideal": 3
},
{
"timeSlotId": "15_16",
"ideal": 2
}
]
}
],
"constraints": {
"weekendDistributionConstraints": [
{
"id": "weekendDistribution",
"weight": 100,
"fairness": {
"fairnessWeight": 100
},
"maxWorkingWeekends": 1,
"employeeIds": [
"1",
"2",
"3",
"4",
"5"
]
}
]
},
"configuration": {
"workTypes": [
{
"id": "1",
"name": "WORK",
"factor": 1.0
}
],
"weekend": {
"startWeekDay": 6,
"endWeekDay": 7
},
}
}