namespace SeaHaven.DataServices.Models;
///
/// Server-derived feed scope. null is org-wide;
/// null means every dispatcher's work orders.
///
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; }
}
/// A bounded slice of candidates plus the unbounded total they were taken from.
public sealed class NotificationCandidatePage
{
public int Total { get; init; }
public IReadOnlyList Items { get; init; } = Array.Empty();
}
///
/// Server-derived scope for items addressed to one person: is the signed-in
/// user from claims and null is org-wide.
///
public sealed record NotificationPersonalScope(int? AccountId, string UserId);
/// An open work order assigned to the user, with when and by whom it was last assigned.
public sealed class NotificationAssignmentCandidate
{
public int WorkOrderId { get; init; }
public string? Number { get; init; }
public DateTime AssignedAt { get; init; }
public string? AssignedBy { get; init; }
}
public sealed class NotificationCommentCandidate
{
public int CommentId { get; init; }
public int WorkOrderId { get; init; }
public string? WorkOrderNumber { get; init; }
public string? AuthorFirstName { get; init; }
public string? AuthorLastName { get; init; }
/// Free-text author for comments with no user (email sync, vendor portal).
public string? Commenter { get; init; }
public string? Text { get; init; }
public DateTime CreatedAt { get; init; }
}
public sealed class NotificationUpliftDecisionCandidate
{
public int UpliftId { get; init; }
public int WorkOrderId { get; init; }
public string? WorkOrderNumber { get; init; }
public string Status { get; init; } = "";
public decimal Amount { get; init; }
public string? DecisionNote { get; init; }
public DateTime DecidedAt { get; init; }
}