# CumulativeCapRule

Industry: Workforce

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

```ts
import type { CumulativeCapRule } from "@northguild/gmt";
```

## Members

| Member | Type | Description |
| --- | --- | --- |
| `label` | `string` | The caller's name for the rule. The report is keyed by it; labels must be unique. |
| `severity?` | `"violation"` \| `"advisory"` ([`DutySeverity`](/gmt/reference/types/DutySeverity/)) | Whether a failure is a violation or an advisory. |
| `kind` | `"cumulativeCap"` | Selects this rule kind. |
| `statuses` | `S[]` | The statuses whose time is capped. |
| `cap` | `string` | The most time allowed, a positive ISO 8601 duration of exact time. |
| `since` | `Reset<S>` ([`Reset`](/gmt/reference/types/Reset/)) | The rest that starts the count again. |

## Definition

```ts
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>;
};
```

## Used by

- [`dutyViolations`](/gmt/reference/workforce/calculate/dutyViolations/)
- [`evaluateDutyLog`](/gmt/reference/workforce/calculate/evaluateDutyLog/)

## Source

[types/duty.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/types/duty.ts)
