Track machine counters and maintenance with counter and time intervals

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-26 16:52:49 +02:00
co-authored by Claude Sonnet 5.5
parent aac579257a
commit 3e1c671949
53 changed files with 2636 additions and 6 deletions
@@ -31,6 +31,17 @@ final readonly class NewNotification
return new self($userId, NotificationType::TaskStartsSoon, $params, "task_starts:{$taskId}:{$startsOn}:{$userId}", $at);
}
/**
* One notification per maintenance need: the item, its last maintenance
* and the level (coming up or late).
*
* @param array<string, int|string> $params
*/
public static function maintenanceDue(int $userId, int $itemId, ?int $lastRecordId, string $level, array $params, DateTimeImmutable $at): self
{
return new self($userId, NotificationType::MaintenanceDue, $params, 'maintenance:'.$itemId.':'.($lastRecordId ?? 'start').':'.$level.':'.$userId, $at);
}
/**
* Each assignment is its own notification: one removed and added again
* is told again.