For the complete documentation index, see llms.txt. This page is also available as Markdown.

Querying Regulation Checks and Alerts

How to query regulation checks and alerts for an employee

Regulation related data are available only to the user himself or his company's managers

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 submitterType with value in admin|employee . It indicates whether the computation was based on employee's version or admin's version of the data.

  • a list of RegulationCheck describing which regulation rules have been computed for the day and the results.

A RegulationCheck has

  • a type to uniquely identify the rule

  • a label

  • a description

  • a unit with value in day|week indicating if it's a daily rule or a weekly rule

  • an alert object. It is null if no breach was detected. Otherwise the rule is breached and an extra JSON 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_hours Minimum duration in hours of mandatory daily rest for the worker

  • breach_period_start and breach_period_end Start and end of the 24h period where a breach has been detected

  • breach_period_max_break_in_seconds Longest rest duration in seconds on this 24h period. It is shorter than the minimum mandatory duration and this is why an alert has been raised

  • sanction_code NATINF code of the sanction

Example

maximumWorkDayTime

  • night_work indicates if the worker is considered a night worker in the context of this computation

  • max_work_range_in_hours maximum work range for the worker. This value will differ for a night worker

  • work_range_in_seconds work range computed, which is above legal limit

  • work_range_start and work_range_end start and end of the work range

  • sanction_code NATINF code of the sanction

Example

minimumWorkDayBreak

  • work_range_start, work_range_end and work_range_in_seconds Start, end and duration of the work range considered

  • min_break_time_in_minutes minimum break time the worker should have taken

  • total_break_time_in_seconds observed break time in seconds. this break is too short and that's why an alert is raised

  • sanction_code sanction name

Example

maximumUninterruptedWorkTime

  • longest_uninterrupted_work_start and longest_uninterrupted_work_end start and end of the longest uninterrumpted work range

  • longest_uninterrupted_work_in_seconds duration in seconds of this work range, which is above legal limit

  • max_uninterrupted_work_in_hours maximum uninterrumpted work range duration in hours allowed by legislation

  • sanction_code NATINF code of the sanction

Example

maximumWorkedDaysInWeek

  • max_nb_days_worked_by_week maximum number of worked days in a week according to legislation

  • min_weekly_break_in_hours each week, a break of this duration should be observed

  • too_many_days boolean indicates if the worker has worked too many days and breached the first rule

  • rest_duration_s maximum but insufficient break observed by the worker. This field is only present if the second rule has been breached

  • sanction_code NATINF code of the sanction

Exemple

Last updated