mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 06:03:12 +00:00
Reactive/Emergency work orders with a SEV 1-5 level are timed from their
creation against the SEV Respond deadline (2/4/8/24/72 hours, one backend
table). From 50% they are at risk: a dismissable High row in the "SLA at
Risk" section and an entry in the feed's slaAtRisk set with the server
clock (start, deadline, percent) for the banner and toast. From 100% they
are a Critical acknowledge row that only acknowledging removes.
POST /api/notifications/sla/{id}/acknowledge records who and when as a
work-order audit entry ("SLA breach acknowledged by <name>"), scoped to the
caller's feed audience: 404 outside it, 409 before the deadline, 204 when
recorded or already recorded. A later severity change is a new breach.
25 lines
1,010 B
C#
25 lines
1,010 B
C#
using System.Security.Claims;
|
|
|
|
namespace SeaHaven.Services.Interfaces
|
|
{
|
|
public enum SlaBreachAcknowledgementOutcome
|
|
{
|
|
Acknowledged,
|
|
/// <summary>This breach was already acknowledged; nothing new is recorded.</summary>
|
|
AlreadyAcknowledged,
|
|
/// <summary>Not an SLA work order the caller's Notification Center covers (another account or dispatcher, closed, no SEV level).</summary>
|
|
NotFound,
|
|
/// <summary>The work order has not missed its response deadline.</summary>
|
|
NotBreached
|
|
}
|
|
|
|
/// <summary>
|
|
/// Acknowledging a missed SEV response deadline from the Notification Center: records who and when in
|
|
/// the work order's audit history, which is also what removes the breach row from the feed.
|
|
/// </summary>
|
|
public interface ISlaBreachAcknowledgementService
|
|
{
|
|
Task<SlaBreachAcknowledgementOutcome> AcknowledgeAsync(
|
|
ClaimsPrincipal user, int workOrderId, CancellationToken cancellationToken);
|
|
}
|
|
}
|