mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 10:43:13 +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.
27 lines
933 B
C#
27 lines
933 B
C#
namespace SeaHaven.DataServices.Models;
|
|
|
|
/// <summary>
|
|
/// Server-derived feed scope. <see cref="AccountId"/> null is org-wide;
|
|
/// <see cref="DispatcherId"/> null means every dispatcher's work orders.
|
|
/// </summary>
|
|
public sealed record NotificationFeedScope(int? AccountId, string? DispatcherId);
|
|
|
|
public sealed class UnassignedWorkOrdersSummary
|
|
{
|
|
public int Count { get; init; }
|
|
public DateTime? LatestCreatedAt { get; init; }
|
|
}
|
|
|
|
public sealed class NotificationWorkOrderCandidate
|
|
{
|
|
public int Id { get; init; }
|
|
public string? Number { get; init; }
|
|
public DateTime ScheduledDate { get; init; }
|
|
}
|
|
|
|
/// <summary>A bounded slice of candidates plus the unbounded total they were taken from.</summary>
|
|
public sealed class NotificationCandidatePage
|
|
{
|
|
public int Total { get; init; }
|
|
public IReadOnlyList<NotificationWorkOrderCandidate> Items { get; init; } = Array.Empty<NotificationWorkOrderCandidate>();
|
|
}
|