Querying Regulation Checks and Alerts
How to query regulation checks and alerts for an employee
API call example
query {
user(id: Int!) {
regulationComputationsByDay(fromDate: Date, toDate: Date) {
day
regulationComputations {
submitterType
regulationChecks(unit: "day" | "week") {
type
label
description
unit
alert {
extra
}
}
}
}
}
}API will send back a list with an entry for every day between fromDate and toDate where regulation checks data are present.
Each item will contain a list of RegulationComputation describing results for the relevant day.
A RegulationComputation has
a
submitterTypewith value inadmin|employee. It indicates whether the computation was based on employee's version or admin's version of the data.a list of
RegulationCheckdescribing which regulation rules have been computed for the day and the results.
A RegulationCheck has
a
typeto uniquely identify the rulea
labela
descriptiona
unitwith value inday|weekindicating if it's a daily rule or a weekly rulean
alertobject. It isnullif no breach was detected. Otherwise the rule is breached and anextraJSON field will contain additional information
API response example
'Extra' field explanation
The extra field contains some context information based on the alert type
minimumDailyRest
min_daily_break_in_hoursMinimum duration in hours of mandatory daily rest for the workerbreach_period_startandbreach_period_endStart and end of the 24h period where a breach has been detectedbreach_period_max_break_in_secondsLongest rest duration in seconds on this 24h period. It is shorter than the minimum mandatory duration and this is why an alert has been raisedsanction_codeNATINF code of the sanction
Example
maximumWorkDayTime
night_workindicates if the worker is considered a night worker in the context of this computationmax_work_range_in_hoursmaximum work range for the worker. This value will differ for a night workerwork_range_in_secondswork range computed, which is above legal limitwork_range_startandwork_range_endstart and end of the work rangesanction_codeNATINF code of the sanction
Example
minimumWorkDayBreak
work_range_start, work_range_end and work_range_in_secondsStart, end and duration of the work range consideredmin_break_time_in_minutesminimum break time the worker should have takentotal_break_time_in_secondsobserved break time in seconds. this break is too short and that's why an alert is raisedsanction_codesanction name
Example
maximumUninterruptedWorkTime
longest_uninterrupted_work_startandlongest_uninterrupted_work_endstart and end of the longest uninterrumpted work rangelongest_uninterrupted_work_in_secondsduration in seconds of this work range, which is above legal limitmax_uninterrupted_work_in_hoursmaximum uninterrumpted work range duration in hours allowed by legislationsanction_codeNATINF code of the sanction
Example
maximumWorkedDaysInWeek
max_nb_days_worked_by_weekmaximum number of worked days in a week according to legislationmin_weekly_break_in_hourseach week, a break of this duration should be observedtoo_many_daysboolean indicates if the worker has worked too many days and breached the first rulerest_duration_smaximum but insufficient break observed by the worker. This field is only present if the second rule has been breachedsanction_codeNATINF code of the sanction
Exemple
Last updated
