Appearance
Function: caseSlaState()
ts
function caseSlaState(c, now?): "ok" | "none" | "breached" | "due_soon";due_soon starts when slaWarnPct % of the SLA window is left, or by default at the larger of 20 % of the window and two hours before dueAt, capped at half the window so short SLAs are not "due soon" from the start.
Parameters
c
Pick<Case, "dueAt" | "slaBreachedAt" | "status" | "createdAt" | "slaWarnPct">
now?
Date
Returns
"ok" | "none" | "breached" | "due_soon"