Skip to content

CumulativeCapRule

A cap on time in statuses since the last reset: “11 hours driving since 10 hours off”.

import type { CumulativeCapRule } 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"cumulativeCap"Selects this rule kind.
statusesS[]The statuses whose time is capped.
capstringThe most time allowed, a positive ISO 8601 duration of exact time.
sinceReset<S> (Reset)The rest that starts the count again.
type CumulativeCapRule<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: "cumulativeCap";
/** The statuses whose time is capped. */
statuses: S[];
/** The most time allowed, a positive ISO 8601 duration of exact time. */
cap: string;
/** The rest that starts the count again. */
since: Reset<S>;
};

types/duty.ts