Skip to content

Status Rules

Status rules define automatic, time-based status transitions for inventory items: as soon as a device's calibration becomes due, overdue or critical, the device automatically moves from the source to the target status.

The calibration-period timeline (V1 idea)

The rules implement the timeline known from calServer V1: relative to its next calibration date, every device passes through configurable stages, for example:

Unremarkable → Due (-30 d) → Critical 1 (-14 d) → Critical 2 (-7 d)
    → Date/Overdue (0) → Critical 3 (+7 d)

The day values are not constants but the four periods from Basic settings → Rules → "Deadlines & Periods" (description): due period and critical 1–3. Negative counts into the future (before the date), positive into the past (after the date). The Rules tab renders this timeline with the actually configured values, and the condition picker names the concrete window for each stage (e.g. "Due – date within the next 30 days").

A typical V1 setup along the timeline: "Active → Calibration planning" when due, "Active → Locked" when overdue, further stages for escalations. E-mail reminders for the same stages (call sheets, reminder mails) are not status rules — they are configured separately in the e-mail management.

Concept

A status rule consists of:

Element Description
Type Currently inventory (only inventory rules are evaluated)
Source status Status the device must currently be in
Target status Status the device moves to
Condition Due-date reference to the next calibration date
Order Execution order (run_order) when several rules apply

Conditions

The condition refers to the device's next calibration date. The time windows ("due", "critical") come from the calibration settings (due and critical periods).

Condition Trigger
Overdue Calibration date is in the past
Not yet due Calibration date is in the future
Due Date within the due window
Critical 1 / 2 / 3 Date within the respective critical window

"Due" and each critical level additionally offer a … before and … after variant (date before / after the respective boundary) — 14 conditions in total. Other values are rejected by the API (closed set); likewise, rules can only be created for the inventory type, because only those are evaluated.

Examples

Rule Description
Calibration overdue Source "Active", condition "Overdue" → target "Overdue"
Maintenance pending Source "Active", condition "Critical 1" → target "Maintenance Pending"

Create a rule

  1. Navigate to Administration › Status.
  2. Select the Rules tab.
  3. Define source status, target status, condition and order.
  4. Save.

Managing rules requires the Basic settings (admin) permission.

Execution

Status rules are evaluated hourly via the Laravel scheduler (command status:apply-rules). For each rule, all matching devices are set to the target status; every change is recorded in the audit log. Multiple rules run in their configured order, so chains (e.g. "Active → Due → Overdue") are possible.

Automatic transitions do not apply interactive status-change actions (mandatory fields, defaults, follow-up objects) — matching calServer V1's behaviour.

Manual preview

# Shows which transitions would happen without changing any data:
php artisan status:apply-rules --dry-run

Status variables

Status variables (processing-time measurement) are a separate topic, described under Status statistics.