using SeaHaven.DataServices.Models; namespace SeaHaven.DataServices.Interfaces { /// /// Live work-order conditions behind the notification feed. Every query applies the /// base scope (no templates, no deleted rows), the caller's account scope, and the /// shared open rule (not Completed/Canceled, including legacy terminal statuses). /// public interface INotificationFeedDataService { /// Open work orders with no dispatcher assigned in (null is org-wide). Task GetUnassignedSummaryAsync(int? accountId, CancellationToken cancellationToken); /// /// Open, Aveta-required work orders scheduled on or the next day with no /// Aveta document attached. Items are the latest scheduled. /// Task GetAvetaMissingAsync( NotificationFeedScope scope, DateOnly today, int limit, CancellationToken cancellationToken); /// /// Open work orders scheduled at or before with no active vendor dispatch, /// direct or linked. Items are the latest scheduled. /// Task GetNoVendorAsync( NotificationFeedScope scope, DateTime cutoff, int limit, CancellationToken cancellationToken); /// /// Open work orders assigned to the user whose latest assignment happened at or after /// and was made by someone else, read from the latest AssignTo audit /// entry (board create writes one too). Returns at most , newest first. /// Task> GetRecentAssignmentsAsync( NotificationPersonalScope scope, DateTime since, int limit, CancellationToken cancellationToken); /// /// Comments posted at or after by someone other than the user, on work orders /// the user is assigned to, has commented on, or that mention the user, and that the user has not /// commented after. Returns at most , newest first. /// Task> GetUnansweredCommentsAsync( NotificationPersonalScope scope, DateTime since, int limit, CancellationToken cancellationToken); /// /// Approve, reject and revoke decisions made at or after by someone else on /// uplifts the user requested. Returns at most , newest first. /// Task> GetUpliftDecisionsAsync( NotificationPersonalScope scope, DateTime since, int limit, CancellationToken cancellationToken); /// /// Open Reactive/Emergency work orders with a SEV 1–5 level, split by creation time: at risk when /// created at or before but after , breached when /// created at or before and not yet acknowledged for their current level. /// Breaches are the newest; the at-risk set is bounded by the longest window. /// Task GetSlaCandidatesAsync( NotificationFeedScope scope, NotificationSlaCutoffs atRisk, NotificationSlaCutoffs breached, int breachedLimit, CancellationToken cancellationToken); /// The work order as an SLA candidate inside , or null when it is not one. Task GetSlaCandidateAsync( NotificationFeedScope scope, int workOrderId, CancellationToken cancellationToken); } }