mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 08:23:12 +00:00
Adds GET /api/notifications, a per-user read model derived from live work-order state: Unassigned (grouped, High), No Vendor and Aveta Missing (per work order, Medium) and Vendor Conflict, account-scoped from claims and ordered by section severity with a fixed reason tie-break.
29 lines
1.5 KiB
C#
29 lines
1.5 KiB
C#
using SeaHaven.DataServices.Models;
|
|
|
|
namespace SeaHaven.DataServices.Interfaces
|
|
{
|
|
/// <summary>
|
|
/// 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).
|
|
/// </summary>
|
|
public interface INotificationFeedDataService
|
|
{
|
|
/// <summary>Open work orders with no dispatcher assigned in <paramref name="accountId"/> (null is org-wide).</summary>
|
|
Task<UnassignedWorkOrdersSummary> GetUnassignedSummaryAsync(int? accountId, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Open, Aveta-required work orders scheduled on <paramref name="today"/> or the next day with no
|
|
/// Aveta document attached. Items are the <paramref name="limit"/> latest scheduled.
|
|
/// </summary>
|
|
Task<NotificationCandidatePage> GetAvetaMissingAsync(
|
|
NotificationFeedScope scope, DateOnly today, int limit, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Open work orders scheduled at or before <paramref name="cutoff"/> with no active vendor dispatch,
|
|
/// direct or linked. Items are the <paramref name="limit"/> latest scheduled.
|
|
/// </summary>
|
|
Task<NotificationCandidatePage> GetNoVendorAsync(
|
|
NotificationFeedScope scope, DateTime cutoff, int limit, CancellationToken cancellationToken);
|
|
}
|
|
}
|