shoc-backend/SeaHaven.DataServices/Models/NotificationFeedReadModels.cs
Alexandre Brandizzi da0b29f769 feat(notifications): serve the Notification Center feed grouped by reason
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.
2026-09-18 12:40:37 -03:00

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>();
}