Skip to content

RequiredInterruptionRule

A required break after a stretch of counted time: “30 minutes after 8 hours driving”.

import type { RequiredInterruptionRule } from "@northguild/gmt";
MemberTypeDescription
labelstringThe caller’s name for the rule. The report is keyed by it; labels must be unique.
severity?"violation" | "advisory" (DutySeverity)Whether a failure is a violation or an advisory.
kind"requiredInterruption"Selects this rule kind.
countedStatusesS[]The statuses that count towards the stretch.
afterstringThe most counted time allowed without an interruption, a positive ISO 8601 duration.
interruptionobjectWhat counts as an interruption.
interruption.minimumstringThe shortest single run that interrupts, a positive ISO 8601 duration of exact time.
interruption.outsideStatuses?S[]The statuses an interruption may be made of.
interruption.orderedSplit?string[]Shorter runs that together interrupt when taken in this order: ["PT15M", "PT30M"] is a run of at least 15 minutes followed later by one of at least 30, and not the reverse.
type RequiredInterruptionRule<S extends string = string> = {
/** The caller's name for the rule. The report is keyed by it; labels must be unique. */
label: string;
/**
* Whether a failure is a violation or an advisory.
*
* @defaultValue `"violation"`.
*/
severity?: DutySeverity;
/** Selects this rule kind. */
kind: "requiredInterruption";
/** The statuses that count towards the stretch. */
countedStatuses: S[];
/** The most counted time allowed without an interruption, a positive ISO 8601 duration. */
after: string;
/** What counts as an interruption. */
interruption: {
/** The shortest single run that interrupts, a positive ISO 8601 duration of exact time. */
minimum: string;
/**
* The statuses an interruption may be made of.
*
* @defaultValue None. Any logged status outside `countedStatuses` interrupts.
*/
outsideStatuses?: S[];
/**
* Shorter runs that together interrupt when taken in this order: `["PT15M", "PT30M"]` is a
* run of at least 15 minutes followed later by one of at least 30, and not the reverse.
*
* @defaultValue None. Only a run of `minimum` interrupts.
*/
orderedSplit?: string[];
};
};

types/duty.ts